ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Giving focus to a particular sheet (https://www.excelbanter.com/excel-programming/319089-giving-focus-particular-sheet.html)

R A

Giving focus to a particular sheet
 
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



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Patrick Molloy[_2_]

Giving focus to a particular sheet
 
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

"R A" wrote:

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



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Jules[_7_]

Giving focus to a particular sheet
 
By number:
Application.Sheets(1).select
By name:
Application.Sheets("sheet1").select


"R A" wrote in message
...
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



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!





All times are GMT +1. The time now is 05:29 AM.

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