![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Posts: 1,288
|
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. |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Here you go:
Tom |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Apr 2002
Location: Minnesota
Posts: 821
|
Why not just hide the sheet before you save it and when you open it the next time it will be hidden?
|
|
|
|
|
|
#4 | |
|
Board Regular
Join Date: Mar 2002
Posts: 1,288
|
Quote:
|
|
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
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 |
|
|
|
|
|
#6 |
|
Board Regular
Join Date: Mar 2002
Posts: 1,288
|
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 |
|
|
|
|
|
#7 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
|
Use :
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 |
|
|
|
|
|
#8 | |
|
Board Regular
Join Date: Mar 2002
Posts: 1,288
|
Quote:
Great help. |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|