ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Workbook startup condition (https://www.excelbanter.com/excel-discussion-misc-queries/2011-workbook-startup-condition.html)

wikegolfa

Workbook startup condition
 
I have a workbook with a large number of sheets, one of which acts as an
index. When the workbook is opened it opens to the last sheet in use (I
think). I would like the workbook to open onto a specific sheet (i.e. the
Index sheet) each time regardless of which sheet was last used. Is this
possible?

Thanks in anticipation
Adrian

JulieD

Hi Adrian

yes, it is possible with a bit of VBA code
right mouse click on a sheet tab
choose view / code - this will open the VBE window
on the left of the screen you should see the name of your workbook in
brackets & bold
under it you should see ThisWorkbook
(if you can't see these try view / project explorer)
double click on ThisWorkbook
on the top right of the screen you should see two drop down boxes
on the left on choose Workbook and a sub should be created for you along the
lines of
sub Workbook_Open()

end sub

copy & paste the following line of code between these two lines

Sheets("Index").Activate

where Index is the name of your sheet

now use ALT & F11 to switch back to the workbook
close & save the workbook - open & test

Cheers
julieD

"wikegolfa" wrote in message
...
I have a workbook with a large number of sheets, one of which acts as an
index. When the workbook is opened it opens to the last sheet in use (I
think). I would like the workbook to open onto a specific sheet (i.e. the
Index sheet) each time regardless of which sheet was last used. Is this
possible?

Thanks in anticipation
Adrian




wikegolfa

Julie,
That was easy - worked 1st time. Thanks for your clear instructions.
Regards
Adrian

"JulieD" wrote:

Hi Adrian

yes, it is possible with a bit of VBA code
right mouse click on a sheet tab
choose view / code - this will open the VBE window
on the left of the screen you should see the name of your workbook in
brackets & bold
under it you should see ThisWorkbook
(if you can't see these try view / project explorer)
double click on ThisWorkbook
on the top right of the screen you should see two drop down boxes
on the left on choose Workbook and a sub should be created for you along the
lines of
sub Workbook_Open()

end sub

copy & paste the following line of code between these two lines

Sheets("Index").Activate

where Index is the name of your sheet

now use ALT & F11 to switch back to the workbook
close & save the workbook - open & test

Cheers
julieD

"wikegolfa" wrote in message
...
I have a workbook with a large number of sheets, one of which acts as an
index. When the workbook is opened it opens to the last sheet in use (I
think). I would like the workbook to open onto a specific sheet (i.e. the
Index sheet) each time regardless of which sheet was last used. Is this
possible?

Thanks in anticipation
Adrian





JulieD

Hi Adrian

glad to assist & thanks for the feedback.

Cheers
JulieD

"wikegolfa" wrote in message
...
Julie,
That was easy - worked 1st time. Thanks for your clear instructions.
Regards
Adrian

"JulieD" wrote:

Hi Adrian

yes, it is possible with a bit of VBA code
right mouse click on a sheet tab
choose view / code - this will open the VBE window
on the left of the screen you should see the name of your workbook in
brackets & bold
under it you should see ThisWorkbook
(if you can't see these try view / project explorer)
double click on ThisWorkbook
on the top right of the screen you should see two drop down boxes
on the left on choose Workbook and a sub should be created for you along
the
lines of
sub Workbook_Open()

end sub

copy & paste the following line of code between these two lines

Sheets("Index").Activate

where Index is the name of your sheet

now use ALT & F11 to switch back to the workbook
close & save the workbook - open & test

Cheers
julieD

"wikegolfa" wrote in message
...
I have a workbook with a large number of sheets, one of which acts as an
index. When the workbook is opened it opens to the last sheet in use (I
think). I would like the workbook to open onto a specific sheet (i.e.
the
Index sheet) each time regardless of which sheet was last used. Is
this
possible?

Thanks in anticipation
Adrian








All times are GMT +1. The time now is 07:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com