Find - replace colors

B

BGN

Is it possible to find cells colored yellow and change to green?

My subtotals on the volume page are colored yellow and when I go t
revenue and cost pages, these have similar layout, but I want
different color scheme on these pages.

Thanks for your help.

BG
 
B

Bob Phillips

Select all the cells

For Each cell In Selection
If cell.Interior.Colorindex = 6 Then
cell.Interior.Colorindex =10
End If
Next cell

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
D

Dana DeLouis

Excel XP can Find/Replace on formatting. Maybe something along these
lines...

Application.FindFormat.Interior.ColorIndex = 6
Application.ReplaceFormat.Interior.ColorIndex = 4
Cells.Replace _
What:=vbNullString, _
Replacement:=vbNullString, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False, _
SearchFormat:=True, _
ReplaceFormat:=True


HTH
Dana DeLouis
 
B

BGN

These are two different tabs, with a lot of models and subtotals. Ther
is nothing for me to specify, except saying if there is sum function i
the cell, to color it one way or the other. I use the same format fo
cells not having any sum functions on the same sheet, so I do not thin
conditional format will work for this case.

Regards,
BG
 
B

BGN

Bob,

Could you please give me more instructions? I tried copying th
formula into an if formula nd it did not work. Do I need to use th
string you provided in a macro format?

Thanks for your help.

Regards,
BG
 
B

Bob Phillips

BGN,

It is VBA code, you can't do a replace with a formula. You also cannot write
this as a UDF, as it alters the Excel environment.

You have to create a VBA procedure in a standard code module and call it
from the Excel Tools>Macros or create and assign it to a button.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Top