HIDDEN SHEET

verluc

Well-known Member
Joined
Mar 1, 2002
Messages
1,451
I have a workbook with 3 sheets.
I want by opening this workbook,that autmatickly sheet1 is hidden.
Can somebody help me with a macro to do this?
Many thanks in advance.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Here you go:

<pre>
Private Sub Workbook_Open()
Sheet1.Visible = xlSheetHidden
End Sub

</pre>

Tom
 
Upvote 0
Why not just hide the sheet before you save it and when you open it the next time it will be hidden?
 
Upvote 0
On 2002-05-07 05:49, TsTom wrote:
Here you go:

<pre>
Private Sub Workbook_Open()
Sheet1.Visible = xlSheetHidden
End Sub

</pre>
Thanks,Tom,but where do I insert this macro?
Many thanks for answer.




Tom
 
Upvote 0
From your Excel worksheet, rightclick on the
Excel icon immediately left of your file menu item(Upper left hand corner), choose "View Code", paste this code there.

If the procedure already exists, then just paste the one line into the existing procedure.

Should end up in your workbook class module.

Tom
 
Upvote 0
On 2002-05-07 06:15, TsTom wrote:
From your Excel worksheet, rightclick on the
Excel icon immediately left of your file menu item(Upper left hand corner), choose "View Code", paste this code there.

If the procedure already exists, then just paste the one line into the existing procedure.

Should end up in your workbook class module.

Tom

[/quote]
Hi,Tom,

I have insert your macro on the place it must.But when I run the macro(open the workbook) then there is another sheet that is hidden and not Sheet1
Any idea?
Thanks
 
Upvote 0
Use :

<pre>
Private Sub Workbook_Open()
Sheets("Sheet1").Visible = xlSheetHidden
End Sub</pre>

This causes the sheet called "Sheet1" to be used and not the programmatic "Sheet1".

The difference is that the sheet called "Sheet1" has the name "Sheet1" on the worksheet nametab.

The programmatic "Sheet1" is the first sheet that was added to the workbook. You've either deleted this or named it something else.

HTH
 
Upvote 0
On 2002-05-07 06:48, Mark O'Brien wrote:
Use :

<pre>
Private Sub Workbook_Open()
Sheets("Sheet1").Visible = xlSheetHidden
End Sub</pre>

This causes the sheet called "Sheet1" to be used and not the programmatic "Sheet1".

The difference is that the sheet called "Sheet1" has the name "Sheet1" on the worksheet nametab.

The programmatic "Sheet1" is the first sheet that was added to the workbook. You've either deleted this or named it something else.

HTH
Thanks Marc and Tom,it works fine now.
Great help.
 
Upvote 0

Forum statistics

Threads
1,213,521
Messages
6,114,109
Members
448,548
Latest member
harryls

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top