Ah, ok.
It actually appears that you can search in both formulas and values at the same time. Just omit the LookIn parameter in your code:
Before
Cells.Find(C, ActiveCell, xlValues, xlPart, xlByColumns, xlPrevious).Activate
After
Cells.Find(C, ActiveCell, , xlPart, xlByColumns, xlPrevious).Activate
If your ranges are located next to each other, you can combine them using Union method in VBA. Otherwise I guess you will need to copy (or perform whichever action you need) in a loop.
Please review the following code sample. It highlights all cells where either formula or text contain valueToSearch.
Sub FindValue()
Dim valueToSearch As String
Dim rngFound As Range
Dim firstAddress As String
valueToSearch = "abc"
With Worksheets(1).UsedRange
.Borders(xlEdgeBottom).LineStyle = xlNone
Set rngFound = .Find(valueToSearch)
If Not rngFound Is Nothing Then
firstAddress = rngFound.Address
Do
rngFound.Borders(xlEdgeBottom).Color = RGB(255, 0, 0)
Set rngFound = .FindNext(rngFound)
Loop While Not rngFound Is Nothing And rngFound.Address <> firstAddress
End If
End With
End Sub
Bookmarks