VBA Code to display Message when click on button
Step 1: Open Excel Sheet and go to the Insert tab.
Step 2: Insert one of the by taking shape in Insert Shapes Box.
Step 3: After inserting shape right click on the shape and go to assign macro.
Step 4: New Module window openes and insert the VBA Code shown below and save.(before save you must save your sheet as Macro - Enabled sheet)
Step 5: Change the code as per your requirement as shown below.
Step 6: Now click on the shape and you can see message when you click.
VBA Code:
Sub RoundedRectangle1_Click()
MsgBox "Hello I Am Rahul"
End Sub
Changes to be made at:
MsgBox " "
Comments
Post a Comment