Thread
:
change color of all cells with formula or are part of a formula
View Single Post
#
5
Posted to microsoft.public.excel.misc
Dave Peterson
external usenet poster
Posts: 35,218
change color of all cells with formula or are part of a formula
You could get all the cells at once, too:
Option Explicit
Sub ColorFormulas2()
Dim rng As Range
set rng = nothing
on error resume next 'just in case there are no formulas
Set rng = Cells.SpecialCells(xlCellTypeFormulas)
on error goto 0
if rng is nothing then
'do nothing
else
rng.Interior.Color = vbYellow
end if
End Sub
Ron Rosenfeld wrote:
On Sun, 27 Jan 2008 09:37:27 -0800 (PST),
wrote:
is it possible to change the color of all cells that contain a formula
or are part of a formula???
if so, how would i do that?
You could use a macro. Run the macro below when the Sheet you wish to modify
is active:
=======================
Option Explicit
Sub ColorFormulas()
Dim c As Range
Dim rng As Range
Set rng = Cells.SpecialCells(xlCellTypeFormulas)
For Each c In rng
c.Interior.Color = vbYellow
Next c
End Sub
======================
--ron
--
Dave Peterson
Reply With Quote
Dave Peterson
View Public Profile
Find all posts by Dave Peterson