Modify code for multiple sheets-Help defining array
If I understand your question correctly, I think this code will do what you
want...
Dim X As Long
ActiveSheet.UsedRange.Rows.Hidden = False
For X = 3 To 5
With Worksheets(X).Range("H1:H100")
Do Until .Find("No") Is Nothing
.Find("No").EntireRow.Delete
Loop
Next
Rick
"ToddEZ" wrote in message
...
Hi,
I need some help modifying this "hide row" macro to operate accross sheets
3, 4, & 5 rather than just sheet 1. I realize that I can just copy the
same
code several times (changing the sheet reference) but I was hoping there
is
an eaiser way to define a multiple sheet array for this.
Thanks in advance,
What is the Dim cell As Range
With ActiveSheet.UsedRange
.Rows.Hidden = False
For Each cell In Worksheets("Sheet1").Range("h1:h100")
If cell.Text = "No" Then cell.EntireRow.Hidden = True
Next cell
End With
|