Giving focus to a particular sheet

  • Thread starter Thread starter R A
  • Start date Start date
R

R A

Hi

Wonder if someone could offer some assistance?

When I open a workbook, I was wondering what code I would use in a macro
to give focus to one particular sheet? The sheet is called sheet1
(points for originality!)

Thankyou
 
This kind of query can easily be answered by using the macro recorder and
examining the resulting script - a "must do" for anyone beginning to use VBA

sheetname = "sheet1"
Worksheets(sheetname).activate


Patrick Molloy
Microsoft Excel MVP
 
By number:
Application.Sheets(1).select
By name:
Application.Sheets("sheet1").select
 

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

Back
Top