Formatting rows based criteria

J

Johnny

Hi Everyone: I am new to VBA and need help. I have tried modifying some
other VBA script without success. I need VBA script to find the Rows in
Column A:A which contain "*Total*" ( EXample *0087 TOTAL) then select columns
A:AQ for that row and formats the cell - Interior light Gray, Dark blue Font
and bold.
 
J

Joel

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 7/18/2008 by Joel
'

'
LastRow = Range("A" & Rows.Count).End(xlUp).Row
Set CompareRange = Range("A1:A" & LastRow)
For Each cell In CompareRange
If InStr(cell.Value, "TOTAL") > 0 Then
With cell.EntireRow
.Font.Bold = True
With .Interior
.ColorIndex = 15
.Pattern = xlSolid
End With
.Font.ColorIndex = 11
End With
End If
Next cell
End Sub
 

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