Hiding sheets using code
For i = 1 to Range("B2").value
Worksheets("St" & i).Visible = xlSheetHidden
Next i
--
---
HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my addy)
"Roger on Excel" wrote in message
...
i have a spreadsheet with sheets named as follows
St1, St2, St3, St4, St5 etc...
I would like to enter a number into a cell on a separate sheet that will
result in
only showing the sheets up to that number and hide the rest.
For example if i enter 3, I would like St1, St2 and St3 to show and St4,
St5
etc
to be hidden.
Can anyone help?
|