Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Determine which button was clicked on a sheet

Hi Tom,

This post answered my question - wanted to do the same thing. Which was
great, however when I try to get help on 'Buttons' Excel comes back with :

"Hidden Language Element
You have requested Help for a language element that is hidden, and therefore
unavailable for programmatic access. "

which is a bummer as if there is a buttons object that would be so much
simpler than mucking around with shapes.

any ideas on why excel is 'hidding' a button object?

cheers,

Paul B.



"Tom Ogilvy" wrote:

Sub Btn_click()
Dim sBtnName as String
Dim btn as Button
sBtnName = Application.Caller
set btn = Activesheet.buttons(sBtnName)
msgbox btn.Caption
End Sub

--
Regards,
Tom Ogilvy

"XP" wrote:

I have several regular buttons (i.e. not an activeX button) control on a
sheet. All of these buttons run the same user form, but I want the results
placed into separate cells depending upon which button was clicked to load
the form.

Using VBA, can someone please post example code that determines which button
was clicked on the sheet, using the button's caption as the defining variable?

Thanks in advance.

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
Determine which button was clicked on a sheet Norman Jones Excel Programming 1 January 4th 07 02:54 PM
Determine when checkbox is clicked wAyne Excel Discussion (Misc queries) 1 February 21st 06 08:35 PM
Determine last clicked object / control Rex Excel Programming 3 July 15th 05 07:02 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 determine which button was clicked on the modified right-click menu Patrick Choi Excel Programming 1 September 1st 03 02:07 PM


All times are GMT +1. The time now is 02:09 AM.

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

About Us

"It's about Microsoft Excel"