Code to make sheets in a workbook visible

  • Thread starter Thread starter Jonsson
  • Start date Start date
J

Jonsson

Hi all,

I need help to create a code that makes the sheets in a workbook hidde
or unhidden.

I have screwed up and now my sheets are Veryhidden from the bar!

Anyone?

Thanks,

Thoma
 
Thomas,

First bit makes them all visible
Second bit makes the first worksheet hidden (but not VeryHidden)

Sub test()
Dim wks As Worksheet

For Each wks In ActiveWorkbook.Worksheets
wks.Visible = xlSheetVisible
Next

ActiveWorkbook.Worksheets(1).Visible = xlSheetHidden
End Sub
 
Jonsson ,

worksheets("Results").visible=true 'xlHidden to hide, xlVeryHidden to very
hide

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Alt+F11 takes you to the VBE. Select your project in the Project window,
then select each sheet in turn. In the properties window (hit F4 if not
visible), select visible and change to xlSheetVisible.
 
wrkBook is the name of the worksheet in thich you want to add the work
sheets :-) i think it will help you out

For l = 0 To 4
wrkBook.Worksheets.Add
Next l
 
Back
Top