ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Open file to specific tab (https://www.excelbanter.com/excel-discussion-misc-queries/94289-open-file-specific-tab.html)

[email protected]

Open file to specific tab
 
Is it possible to make a document open to a certain tab and a specific
cell? I manage a workbook and share it with a large number of people
and would like it to always open to the "Instruction" tab and cell A1.

Thank you.

Chip


michaelberrier

Open file to specific tab
 
To make sure it always opens where you want, do these two things:
1. Open the VBA editor and put this in the ThisWorkBook code module:

Private Sub Workbook_Open()
Application.Run "InstructionSheet"
End Sub

2. Put this into a regular module:

Sub InstructionSheet()
Sheets("Instruction").Range("A1").Select
End Sub

That ought to do it.


[email protected]

Open file to specific tab
 

michaelberrier wrote:
To make sure it always opens where you want, do these two things:
1. Open the VBA editor and put this in the ThisWorkBook code module:

Private Sub Workbook_Open()
Application.Run "InstructionSheet"
End Sub

2. Put this into a regular module:

Sub InstructionSheet()
Sheets("Instruction").Range("A1").Select
End Sub

That ought to do it.


How about doing it without using VBA? I've never used it before. I
don't know if it's difficult to use or not, it's just that I'm not
familiar with it.


michaelberrier

Open file to specific tab
 
That's the only way to do it that I know of. This particular operation
in VBA is really simple.
In the Excel window, type Alt+F11 to open the VBA editor. From there,
just copy and paste the code below.


wrote:
michaelberrier wrote:
To make sure it always opens where you want, do these two things:
1. Open the VBA editor and put this in the ThisWorkBook code module:

Private Sub Workbook_Open()
Application.Run "InstructionSheet"
End Sub

2. Put this into a regular module:

Sub InstructionSheet()
Sheets("Instruction").Range("A1").Select
End Sub

That ought to do it.


How about doing it without using VBA? I've never used it before. I
don't know if it's difficult to use or not, it's just that I'm not
familiar with it.



[email protected]

Open file to specific tab
 
I'll give it a try. Thanks.


Dave Peterson

Open file to specific tab
 
Instead of using Application.run, I think I'd use:

Private Sub Workbook_Open()
Call InstructionSheet
End Sub

Or just drop the workbook_Open event and use Auto_Open:

Sub Auto_Open
with Sheets("Instruction")
.select
.Range("A1").Select
end with
End Sub

(If Instruction isn't the activesheet, then the code to select A1 will fail.)


michaelberrier wrote:

To make sure it always opens where you want, do these two things:
1. Open the VBA editor and put this in the ThisWorkBook code module:

Private Sub Workbook_Open()
Application.Run "InstructionSheet"
End Sub

2. Put this into a regular module:

Sub InstructionSheet()
Sheets("Instruction").Range("A1").Select
End Sub

That ought to do it.


--

Dave Peterson


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

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