Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default An easy one!

I have 16 contol buttons that all launch the same sub. How can I make the code recognise which button was pressed?

Is there a way to rename (not the text) a button differently from what Excel assigns?

Any help is appriciated
Schwartz

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default An easy one!

Dr Schwartz,

I assume that you are either using worksheet control toolbox buttons or
userform buttons (as worksheet Forms button prompt for a macro to be
assigned). In both of these cases, if you double-click the object whilst in
design mode, you will be presented with a skeleton click event module, where
you can add your code.

To rename them, when selected, go into the Properties pane, and change the
name.

--

HTH

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

"Dr. Schwartz" wrote in message
...
I have 16 contol buttons that all launch the same sub. How can I make the

code recognise which button was pressed?

Is there a way to rename (not the text) a button differently from what

Excel assigns?

Any help is appriciated
Schwartz



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default An easy one!

This file might be a help:
http://www.bygsoftware.com/examples/...s/apcaller.zip
It's in the "Worksheet with VBA" section on page:
http://www.bygsoftware.com/examples/examples.htm

A short demo that reports which of three buttons was pressed

--
Regards
Andy Wiggins
www.BygSoftware.com
Home of "Save and BackUp",
"The Excel Auditor" and "Byg Tools for VBA"



"Dr. Schwartz" wrote in message
...
I have 16 contol buttons that all launch the same sub. How can I make the

code recognise which button was pressed?

Is there a way to rename (not the text) a button differently from what

Excel assigns?

Any help is appriciated
Schwartz



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
I'm sure it must be easy BrianH Excel Discussion (Misc queries) 5 October 4th 07 11:31 AM
This should be easy: Jaytee Excel Discussion (Misc queries) 3 October 1st 06 03:56 PM
This should be easy Kypreo Excel Worksheet Functions 5 November 22nd 05 05:28 AM
Easy one pkbro Excel Worksheet Functions 1 August 5th 05 05:01 PM
new user with easy question? not easy for me speakeztruth New Users to Excel 5 June 3rd 05 09:40 PM


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