Hide Sheets to Left Q

S

Seanie

What code could I use to hide all sheets to the "left" of where the
active cell is?
 
A

AB

try this:
Sub HideLefSheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Index < ActiveSheet.Index Then ws.Visible =
xlSheetHidden
Next ws
End Sub
 
S

Seanie

try this:
Sub HideLefSheets()
    Dim ws As Worksheet
    For Each ws In ThisWorkbook.Worksheets
        If ws.Index < ActiveSheet.Index Then ws.Visible =
xlSheetHidden
    Next ws
End Sub



- Show quoted text -

Perfect, thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top