Reputation: 1117
In VBA Excel, I can choose cells based if they have formulas or values.
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? 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.
Upvotes: 0
Views: 261
Reputation: 5046
Good news ! SpecialCells functionality is in beta now! We now support range areas and also specialCells please give it a try and send us feedback. https://learn.microsoft.com/en-us/office/dev/add-ins/excel/excel-add-ins-multiple-ranges
Upvotes: 1
Reputation: 13500
I don't believe the functionality that you've described is currently available in the 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.
Upvotes: 1