LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default 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


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change the color of cells having formula. Arup C[_2_] Excel Discussion (Misc queries) 5 November 2nd 07 10:50 AM
Change part of formula [email protected] Excel Worksheet Functions 2 October 8th 06 08:50 PM
Change font and background color of several cells based on result of a formula Zenaida Excel Discussion (Misc queries) 2 April 27th 06 06:46 PM
can I use the 'fill color' as part of a formula scottnoidea Excel Discussion (Misc queries) 1 June 29th 05 12:13 PM
Keeping one part of a formula same, but change other cell ref? kwelp Excel Discussion (Misc queries) 3 May 17th 05 10:00 PM


All times are GMT +1. The time now is 11:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"