Run macro on all worksheets within workbook
I see some good code replies. However, all you're doing
is setting a row's color to red if the cell in A contains
the text " Date"
Seems to me that all yuo need to do is set a conditional
format on all the sheets.
First select all the sheets. Make sure the tabs are
visible, slect the first sheet, hold down shift & select
the last sheet.
Now slecty all the cells by clicking the 'cell' above
the '1' row and left of the 'A' column. Click
Format/Conditional Formatting , change to Formula Is and
enter
=($A1=" Date")
set the format to the Patter required.
Note that A1 must be the 'active' cell.
Any row in any sheet where the cell in column A is '
Date' will be red.
Patrick Molloy
-----Original Message-----
I have a simple macro that highlights entire row based
on specific
value within specified range.
Sub RowHighlight()
Dim DataRng As Range
Dim LastRow As Long
Dim cell As Range
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
Set DataRng = Range("A3:A7")
For Each cell In DataRng
If cell.Value = " Date" Then
cell.EntireRow.Interior.ColorIndex = 3
End If
Next cell
End Sub
My workbook has more than a 100 worksheets...it would be
a pain to tab
through all of them and run this macro.
How do I make it run through all worksheets?
Any help would be greatly appreciated.
Thanks,
Mark
.
|