Conditional Formatting

R

RiotLoadTime

For Excel 2002

In an Excel workbook with 5 worksheets, I'm looking for a way to find
all the cells that reference AC3 in a formula or contain "AC3" for
whatever reason. I thought you might be able to use conditional
formatting for that, but I wasn't sure how. Is there another way to do
it? I also don't know how to find the cells once you've formatted them
(say, by changing their color to red).

Thanks,
-RiotLoadTime
 
R

raypayette

Here is the essential code:

For Each c In ActiveSheet.UsedRange
c.Select
If c.HasFormula Then
If InStr(1, c.Formula, "D4") > 0 Then
MsgBox c.Formula
End If
End If
Next
 
R

RiotLoadTime

Thanks for your help Ray. I know this is a very novice question, but
where do I copy the code to and how do I run it?

Thanks again,
-RiotLoadTime
 
R

raypayette

To be more explicit this improved code would be placed in an ordinar
module and you would give it a name:

Sub findD4()
For Each wks In Worksheets
wks.Select
For Each c In ActiveSheet.UsedRange
c.Select
If c.HasFormula Then
If InStr(1, c.Formula, "D4") > 0 Then
'MsgBox c.Formula
MsgBox ActiveSheet.Name & " " & c.Address
End If
End If
Next
Next
End Sub

and click the run button
 
Top