0

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.

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

Comments

1

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.

2 Comments

Yes, it is not supported. I've created a link for this idea here: officespdev.uservoice.com/forums/…
Please see my latest: this is now in beta !

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.