D Dave B Jul 31, 2004 #1 How do I get a macro to run when I start a file? I want the file to start on a specific sheet each time I open the file.
How do I get a macro to run when I start a file? I want the file to start on a specific sheet each time I open the file.
J JE McGimpsey Jul 31, 2004 #2 Put this in the workbook's ThisWorkbook code module (right-click the workbook title bar and choose View Code): Private Sub Workbook_Open() Sheets("Sheet1").Select End Sub or Private Sub Workbook_Open() Application.GoTo Sheets("Sheet1").Range("A1") End Sub The latter selects a particular cell, naturally.
Put this in the workbook's ThisWorkbook code module (right-click the workbook title bar and choose View Code): Private Sub Workbook_Open() Sheets("Sheet1").Select End Sub or Private Sub Workbook_Open() Application.GoTo Sheets("Sheet1").Range("A1") End Sub The latter selects a particular cell, naturally.
B Bigwheel Aug 1, 2004 #3 Create an auto opening macro ... Sub auto_open() your code here end sub P.S. there's also a complemenary auto_close macro to reset things afterwards (if needed)
Create an auto opening macro ... Sub auto_open() your code here end sub P.S. there's also a complemenary auto_close macro to reset things afterwards (if needed)