VBA code

  • Thread starter Thread starter NIDAL
  • Start date Start date
N

NIDAL

Hi all
Thanks for previous help.It was very helpfull.

Now again I need a code to display group of sheets and activate one of them
and hide other sheets rather than group displayed .

Many thanks if anybody can help.
 
Paste the procedure "DisplayWorksheet" and call that from the command button
click event like below example

DisplayWorksheet ("Sheet1")


Sub DisplayWorksheet(strSheet As String)
'This will hide all other sheets except "Summary" and display strSheet
Application.ScreenUpdating = False
For Each wstemp In ActiveWorkbook.Sheets
If wstemp.Name <> "Summary" Then wstemp.Visible = False
Next
ActiveWorkbook.Sheets(strSheet).Visible = True
Application.ScreenUpdating = True
End Sub
 

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

Back
Top