OPEN A WORKBOOK TO A SPECIFIC WORKSHEET

T

Todd

I'm using Excel 2003 and trying to figure out how I can open to a specific
worksheet within the workbook. For example, I have tabs with Jan-Dec. I
want to set the workbook to open to the March worksheet automatically. Then
next month I want to change that setting so it will automatically open to the
April worksheet.

Is there a way to make Excel do that?

Thanks.

Todd
 
D

Dave Peterson

Option Explicit
Sub Auto_Open()
on error resume next
application.goto thisworkbook.worksheets(format(date,"mmm")).range("a1"), _
scroll:=true
if err.number <> 0 then
beep
err.clear
end if
on error goto 0
End Sub

This goes in a General module--not behind a worksheet, not behind ThisWorkbook.
 
T

Tyro

Yes. The workbook will open to the worksheet that was active when the
workbook was saved. So just save it with the desired worksheet active.

Tyro
 

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