Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
R A R A is offline
external usenet poster
 
Posts: 3
Default 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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default 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!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ADDING/DELETING SHEET Without losing focus? Faraz A. Qureshi Excel Discussion (Misc queries) 1 July 29th 09 12:55 PM
HELP!! Unhide Sheet with Macro and focus on other sheet [email protected] Excel Discussion (Misc queries) 2 May 23rd 06 07:17 PM
Printing switches focus off proper sheet Abi Excel Worksheet Functions 1 January 26th 05 07:42 PM
Focus sheet Max Potters Excel Programming 3 October 4th 04 06:53 AM
Adding a new sheet (no focus) SOS[_26_] Excel Programming 2 September 3rd 04 09:19 AM


All times are GMT +1. The time now is 06:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"