ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   How to open a workbook with a specific worksheet displayed by defa (https://www.excelbanter.com/new-users-excel/4916-how-open-workbook-specific-worksheet-displayed-defa.html)

ThaiNB

How to open a workbook with a specific worksheet displayed by defa
 
When I open a workbook, it always shows a specific worksheet which I don't
want to work with. I have to click on the worksheet I want everytime I open
this workbook. How can I open it and have it shows the worksheet I want by
default?

Thanx in advance.

Rob van Gelder

From the Tools menu, select Macro | Visual Basic Editor
From the Project window, doubleclick ThisWorkbook

Assuming Sheet2 is the worksheet you want activated when the workbook opens.

Copy this code in:

Private Sub Workbook_Open()
Worksheets("Sheet2").Activate
End Sub

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"ThaiNB" wrote in message
...
When I open a workbook, it always shows a specific worksheet which I don't
want to work with. I have to click on the worksheet I want everytime I
open
this workbook. How can I open it and have it shows the worksheet I want by
default?

Thanx in advance.




ThaiNB

Thanks a million!

Upon following your procedure, I found something. This workbook was shared
among several users (though, I was the only one opening it). And I think that
was the main reason it didn't let me save the current worksheet state. After
I unshared the workbook, I could save it with the current worksheet state
(means - when I opened it again, it showed the last worksheet I opened last
time before I saved the file). BTW, this is not true on my colleage's machine
(working on the same file!!). I don't want any furthur remedy, just to share
what'd happened.

Thanx again! :)

"Rob van Gelder" เขียน:

From the Tools menu, select Macro | Visual Basic Editor
From the Project window, doubleclick ThisWorkbook

Assuming Sheet2 is the worksheet you want activated when the workbook opens.

Copy this code in:

Private Sub Workbook_Open()
Worksheets("Sheet2").Activate
End Sub

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"ThaiNB" wrote in message
...
When I open a workbook, it always shows a specific worksheet which I don't
want to work with. I have to click on the worksheet I want everytime I
open
this workbook. How can I open it and have it shows the worksheet I want by
default?

Thanx in advance.






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

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