Sub ClickonwhichButton() ' Assign the calling object to a variable. ButtonName = Application.Caller ' Display the name of the button that was clicked. Select Case ButtonName ' NOTE: When you type the name of the button, note that ' Visual Basic is case and space sensitive when comparing ' strings. For example, "Button 6" and "button6" are not the ' same. Case "Button 6" MsgBox Application.Caller & " was Clicked" Case "Button 7" MsgBox Application.Caller & " was clicked." Case "Button 8" MsgBox Application.Caller & " was clicked." End Select End Sub
To update on new Automation Techniques using Excel,Ms Access, SQL Server, Power BI and ASP.Net
Wednesday, October 2, 2013
VBA Code to Display Which Button was Pressed
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment