Hide a sequence of rows
Bernie can you tell me more about the single quote
in the line:
----------------------------------
myRec.Value = "'27:51"
---------------------------------
Thanks
"Bernie Deitrick" wrote:
Dominique,
You can do it by keeping a record of what needs to be hidden in another
cell. For example, if Z1 is currently blank, try the macro below. Of
course, you can change the Z1 to any cell you want.
HTH,
Bernie
MS Excel MVP
Sub DomHideRows()
Dim myRec As Range
Set myRec = Range("Z1")
If myRec.Value = "" Then
myRec.Value = "'27:51"
Range("2:26").EntireRow.Hidden = True
Else
Range(myRec.Value).EntireRow.Hidden = True
myRec.Value = "'" & Range(myRec.Value).Offset(25).Address
End If
End Sub
"Dominique Feteau" wrote in message
...
I would like to hide a sequence of rows. I would run the macro and rows
2-26 would be hidden. I would like to run the macro again a week later
and
hide the next 25 rows.
How do i do that?
dominique
|