What is the code to check which of two cmd buttons is clicked, and accordingly invoke a function?
What is the code to check which of two cmd buttons is clicked, and accordingly invoke a function?
Why not use a toggle button? What application is this for Word, Excel?
Steve
"Nearly all men can stand adversity, but if you want to test a man's character, give him power."
-Abraham Lincoln
this is in excel, I have 2 buttons, both invoke calendars, but depending on which button is clicked, the date is entered into a specified cell.
I would need a little more information before I could help you much. The first question that comes to mind is why not "invoke the function" on button click. Unless I am not understanding you, I'm not sure what you mean by "invoke the function"
Are the buttons on a sheet or a userform?
Thread moved to the Excel help forum..You will stand a better chance of getting help in the appropriate forum...
Steve
"Nearly all men can stand adversity, but if you want to test a man's character, give him power."
-Abraham Lincoln
If it is a commandbutton on a spreadsheet
[VBA]MsgBox "The Command Button named " & Application.Caller & " was pressed."[/VBA]
you could also pass a variable to a select case and display the result in a cell. don't know what your trying to use it for to be of much more help