auto.pilot
Well-known Member
- Joined
- Sep 27, 2007
- Messages
- 734
- Office Version
- 365
- Platform
- Windows
I have the following which highlights all cells on the active sheet that are Type Constants. Instead, I'd like to specify a range of cells (B4:D13) rather than the whole sheet.
How can I do this?
Also... I would like a VBA solution, not conditional formatting.
Thanks in advance.
How can I do this?
Also... I would like a VBA solution, not conditional formatting.
VBA Code:
Sub NonFormulaCells()
Dim ws As Worksheet
Dim rng As Range
Set ws = ActiveSheet
For Each rng In ws.Cells.SpecialCells(xlCellTypeConstants)
rng.Interior.ColorIndex = 36
Next rng
End Sub
Thanks in advance.