Find Character & Highlight Cell

J

J-Money

I'm trying to hightlight cells that have the asterisk (*) symbol in
them. I have tried a couple things, but it is not coming to fruition.
Can somebody please look at my code below and let me know what I am
missing or suggest a better method at getting to the end result?

------------------------------------------
Dim c As Range
Dim rng As Range

For Each c In Sheets("Sheet1").Range(Cells(1, "A"),
Cells(Rows.Count, "K").End(xlUp))
If c = Sheets("Sheet1").Range("F2") Then
Set rng = Sheets("Sheet1").Range(Cells(c.Row, "A"),
Cells(c.Row, "K"))
With rng.Interior
.ColorIndex = 16
.Pattern = xlSolid
End With
End If
Next c
 
T

Tom Ogilvy

If c.Text = Sheets("Sheet1").Range("F2").Text

If you are using the Find command either manually or in code, use ~*
instead of just *
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top