简体   繁体   English

Excel JavaScript API中的SpecialCells

[英]SpecialCells in Excel JavaScript API

In VBA Excel, I can choose cells based if they have formulas or values. 在VBA Excel中,如果它们具有公式或值,我可以选择它们。

Sub ColorCells()
    Dim rng As Range

    Set rng = ActiveSheet.UsedRange.SpecialCells(xlCellTypeConstants)
    rng.Interior.Color = RGB(200, 200, 200)

    Set rng = ActiveSheet.UsedRange.SpecialCells(xlCellTypeFormulas)
    rng.Interior.Color = RGB(0, 200, 1)
End Sub

Also, I can specify if I want to get only text values, numbers, errors and/or booleans. 另外,我可以指定是否只想获取文本值,数字,错误和/或布尔值。

How can I do that with Excel JavaScript API? 如何使用Excel JavaScript API做到这一点? It is a pretty important method. 这是一个非常重要的方法。 Currently, I'm looping all the worksheet's used range rectangle to get the values, and my loops spend a lot of time in blank cells. 目前,我正在循环使用所有工作表的使用范围矩形以获取值,并且循环在空白单元格中花费了大量时间。

I don't believe the functionality that you've described is currently available in the Excel JavaScript API. 我不认为您描述的功能当前在Excel JavaScript API中可用。 If you'd like to add this feature request to Office Developer Platform UserVoice , other users can vote on it there, enabling the Office PM team to get a sense for overall priority/demand as they plan for future enhancements to the API. 如果您想将此功能请求添加到Office Developer Platform UserVoice ,则其他用户可以在那里投票,使Office PM团队在计划将来对API进行增强时可以对总体优先级/需求有所了解。

Good news ! 好消息 ! SpecialCells functionality is in beta now! SpecialCells功能现在处于beta版! We now support range areas and also specialCells please give it a try and send us feedback. 我们现在支持范围区域,也支持specialCells,请尝试一下并向我们发送反馈。 https://docs.microsoft.com/en-us/office/dev/add-ins/excel/excel-add-ins-multiple-ranges https://docs.microsoft.com/zh-cn/office/dev/add-ins/excel/excel-add-ins-multiple-ranges

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM