View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Formatting rows based criteria

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


"Johnny" wrote:

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.
--
Johnny