color row using macro..
Hi,
Right click your sheet tab, view code and paste this in and run it
Sub marine()
Dim myrange, MyRange1 As Range
lastrow = Cells(Rows.Count, "C").End(xlUp).Row
Set myrange = Range("C1:C" & lastrow)
For Each c In myrange
If UCase(c.Value) = "TOTAL" Then
If MyRange1 Is Nothing Then
Set MyRange1 = c.EntireRow
Else
Set MyRange1 = Union(MyRange1, c.EntireRow)
End If
End If
Next
MyRange1.Interior.ColorIndex = 41
End Sub
Mike
" wrote:
Hi,
Is there any way to use a macro to find a word example "Total" in a
column example "C:C" and when it finds the word it will color that row
say "Blue" and then find next and if find more do the same all the way
to the end of the column.
Thanks
|