ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Excel 2003 - How do I change which sheet in my workbook opens firs (https://www.excelbanter.com/excel-discussion-misc-queries/158298-excel-2003-how-do-i-change-sheet-my-workbook-opens-firs.html)

ExtraLarge XL User

Excel 2003 - How do I change which sheet in my workbook opens firs
 
I have a multiple sheet Excel workbook that I reference often, but it opens
to a middle sheet, not to the first sheet like I want. Any ideas?

Dave Peterson

Excel 2003 - How do I change which sheet in my workbook opens firs
 
If you save the workbook with the "correct" worksheet the active worksheet, then
excel remembers that the next time you open it.

If you don't want to do that, you can use a macro to select the sheet that you
want. This goes into a general module:

Option Explicit
Sub Auto_Open()
application.goto thisworkbook.worksheets("sheet9999").range("a1"), _
scroll:=true
End Sub

Change the sheet name to what you want.

ExtraLarge XL User wrote:

I have a multiple sheet Excel workbook that I reference often, but it opens
to a middle sheet, not to the first sheet like I want. Any ideas?


--

Dave Peterson

JLatham

Excel 2003 - How do I change which sheet in my workbook opens firs
 
Put this one-liner in the workbook's _Open() event handler:

Worksheets(1).Activate

To get the right click on the Excel icon immediately to the left of the
"File" menu option in the Excel window and choose [View Code] from the list.
Copy the code below and paste it into the code module presented to you:

Private Sub Workbook_Open()
ThisWorkbook.Worksheets(1).Activate
End Sub

That's a macro, so you're going to have to enable macros when you open the
workbook for it to happen. You may need to set your macro security to allow
it to run. I recommend a Macro Security (Tools | Macro | Security) setting
of Medium vs Low. You'll get a 'nag' when you open the workbook, but I'd
rather put up with that than to have someone send me a workbook with
malicious code and allow it to run without alerting me. Once you change the
security level setting you have to close Excel and then reopen for the new
setting to take effect.

"ExtraLarge XL User" wrote:

I have a multiple sheet Excel workbook that I reference often, but it opens
to a middle sheet, not to the first sheet like I want. Any ideas?



All times are GMT +1. The time now is 12:44 AM.

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