Code to make sheets in a workbook visible

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
 
R

Rob van Gelder

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
 
B

Bob Phillips

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)
 
T

Tom Ogilvy

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.
 
U

Ussiddiqui

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
 
Top