macro for sheet hide

K

kalpesh

Hello

a workbook contain 5 workshee

i work in sheet
i would like hide other sheets by macr

any help?
 
I

isabelle

hi,

in ThisworkBook


Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Application.EnableEvents = False
For i = 1 To Sheets.Count
If Sheets(i).Name <> Sh.Name Then Sheets(i).Visible = False
Next
Application.EnableEvents = True
End Sub



--
isabelle




Le 2012-02-18 12:23, kalpesh a écrit :
 
G

Gord Dibben

Do you mean working in Sheet1 specifically or any sheet you are
working on?

If you do hide them will you want some method of uh-hiding later?

Isabelle's code works on whichever worksheet is currently in use.

If you un-hide a sheet through Format>Sheet>Unhide then it swaps with
the sheet that was visible.

Is that what you want?


Gord
 

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