Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default GoTo Worksheet based on which button clicked

Hi All

I would like to write one routine that handles navigation to different
worksheets based on the name assigned to a button.

- I have a number of navigation buttons on a worksheet (the buttons
are from the Forms toolbar)
- Each button will navigate to a different worksheet
- I have given each button a different name, which is the same name as
the worksheet that it goes to
- For example, the button that goes to Worksheets("TestSheet") has the
name "TestSheet"
- The worksheet with the buttons is protected (so the buttons cannot
be selected)

What I don't know, is how to capture Shapes("TestSheet").Name when it
is clicked. I'd prefer not to have a whole case statement, if
possible.

All suggestions appreciated.

Paul Martin
Melbourne, Australia
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default GoTo Worksheet based on which button clicked

Hi Paul,

Use

MsgBox Application.Caller


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Paul Martin" wrote in message
om...
Hi All

I would like to write one routine that handles navigation to different
worksheets based on the name assigned to a button.

- I have a number of navigation buttons on a worksheet (the buttons
are from the Forms toolbar)
- Each button will navigate to a different worksheet
- I have given each button a different name, which is the same name as
the worksheet that it goes to
- For example, the button that goes to Worksheets("TestSheet") has the
name "TestSheet"
- The worksheet with the buttons is protected (so the buttons cannot
be selected)

What I don't know, is how to capture Shapes("TestSheet").Name when it
is clicked. I'd prefer not to have a whole case statement, if
possible.

All suggestions appreciated.

Paul Martin
Melbourne, Australia



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default GoTo Worksheet based on which button clicked

Thanks, Bob. Brilliant.

Paul



"Bob Phillips" wrote in message ...
Hi Paul,

Use

MsgBox Application.Caller


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Paul Martin" wrote in message
om...
Hi All

I would like to write one routine that handles navigation to different
worksheets based on the name assigned to a button.

- I have a number of navigation buttons on a worksheet (the buttons
are from the Forms toolbar)
- Each button will navigate to a different worksheet
- I have given each button a different name, which is the same name as
the worksheet that it goes to
- For example, the button that goes to Worksheets("TestSheet") has the
name "TestSheet"
- The worksheet with the buttons is protected (so the buttons cannot
be selected)

What I don't know, is how to capture Shapes("TestSheet").Name when it
is clicked. I'd prefer not to have a whole case statement, if
possible.

All suggestions appreciated.

Paul Martin
Melbourne, Australia

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
let a sub recognise the name of the button that has been clicked. Brotherwarren Excel Discussion (Misc queries) 2 March 18th 06 10:56 AM
create a goto button in excel billy boy Excel Worksheet Functions 1 November 25th 05 04:30 PM
Pause macro, add form button to sheet, continue macro when button clicked! Flystar[_15_] Excel Programming 1 May 26th 04 09:45 AM
How to end macro on inital active worksheet containing macro button that was clicked Silverhawk1 Excel Programming 2 May 14th 04 03:58 PM
Detrmine which command button was clicked Jamal[_2_] Excel Programming 4 November 14th 03 12:45 PM


All times are GMT +1. The time now is 08:22 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"