Open excel file and reffer to specific worksheet

G

Guest

Hi! I have a macro that opens an excel file and activates it. How do I get it
to start at a certain worksheet?

Workbooks.Open "X:\SCD_RiskManager_Pos\RMDBII\test.xls" 'open file
Workbooks("test.xls").Activate 'ACTIVATE FILE
 
B

Bill Renaud

In addition to the suggestion by Gary's Student, you can also use the
Activate method:

Sheets("Sheet1").Activate

For simple changing of the active sheet before changing data, either method
may be OK, but when developing more sophisticated applications that have
multiple windows open on the same workbook, I think it is better to use the
Activate method.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top