Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help - Searching Column

Status
Not open for further replies.

Airbisk

Technical User
Apr 28, 2009
43
GB
Hello,

I have the code below that searches for a value and colours the row. Could someone please adjust so that it only searches Column M.

Sub ColorRow()

Application.ScreenUpdating = False

Dim r As Range
For Each r In ActiveSheet.UsedRange
If LCase(r.Value) Like "*/*" Then
Range("A" & r.Row, "M" & r.Row).Interior.Color = 16764108
End If
Next
End Sub

Many Thanks

 
Why not simply use Conditional Formatting ?

Anyway you may use this:
For Each r In ActiveSheet.UsedRange.Columns("M").Cells

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PH - I thought conditional formatting was limited to just the cell and couldn't format cell ranges, I need to check that out becuase that would be a lot better
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top