formatting

K

KRK

Hi, is it possible to automatically display those cells with a formula with
a different format. Eg I would like 'input' cells in green, and
'calculated' cells in red. Thanks.
 
D

Don Guillett

Change color numbers to suit
Sub colorcells()
Dim c As Range
For Each c In Selection
If c.HasFormula Then
c.Interior.ColorIndex = 4
Else
c.Interior.ColorIndex = 6
End If
Next c
End Sub
 
R

Rasoul Khoshravan

Change  color numbers to suit
Sub colorcells()
Dim c As Range
For Each c In Selection
If c.HasFormula Then
c.Interior.ColorIndex = 4
Else
c.Interior.ColorIndex = 6
End If
Next c
End Sub

Hio can we change this macro, so that it automatically recognizes
where the data resides and do it itself, instead of selecting the
range by operator
 
D

Don Guillett

Specify your range.
for each c in range("a2:x22")

If desired, send your workbook to my address and I'll take a look.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
[email protected]
Change color numbers to suit
Sub colorcells()
Dim c As Range
For Each c In Selection
If c.HasFormula Then
c.Interior.ColorIndex = 4
Else
c.Interior.ColorIndex = 6
End If
Next c
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
in message

Hio can we change this macro, so that it automatically recognizes
where the data resides and do it itself, instead of selecting the
range by operator
 
Top