hip2b2
Board Regular
- Joined
- May 5, 2003
- Messages
- 135
- Office Version
- 2019
- Platform
- Windows
VBA Code:
Sub IdentifyFormulaCells()
'Format font in all formula cells RED
Dim ws As Worksheet
Dim rng As Range
Set ws = ActiveSheet
For Each rng In ws.Cells.SpecialCells(xlCellTypeFormulas)
rng.Font.ColorIndex = 3 'NB: 3 = Red
Next rng
End Sub
VBA Code:
Sub UNIdentifyFormulaCells()
' Remove highlight from font in all formula cells.
Dim ws As Worksheet
Dim rng As Range
Set ws = ActiveSheet
For Each rng In ws.Cells.SpecialCells(xlCellTypeFormulas)
rng.Font.ColorIndex = 1 'NB: 1= Black
Next rng
End Sub
I am using these two bits of code to turn the text in cells with formulas Red or Black. Unfortunatly these macros only work on the cells that contain formulas.
What I really need to do is
- Within a fixed range Col A - Col S
- Change the color of the cells that are formulas to Red - Sub IdentifyFormulaCells()
- Change the color of cells that are not formulas to Black - Sub UNIdentifyFormulaCells()
Thanks in advance
hip