3 different command buttons on worksheet to call userform but to change label as well.

danbates

Active Member
Joined
Oct 8, 2017
Messages
377
Office Version
  1. 2016
Platform
  1. Windows
Hi,

I have 3 separate command buttons on my worksheet and I would like to call the same userform but I would like the label1 in the userform to have different title when it opens.

My command buttons are CommandButtonB, CommandButtonG, CommandButtonR and the userform is UserForm2.

Any help would be appreciated.

Thanks
Dan
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
use the following under each of your command buttons
VBA Code:
UserForm1.Caption = "Command Button R"
UserForm1.Show
 
Upvote 0
Try something like this:
Make three buttons and put this script in the button.
Change the name in each script to what you want for the Label

VBA Code:
Sub Show_Me()
'Modified  12/15/2020  2:10:30 AM  EST
Userform1.Label1.Caption = "Jane"
Userform1.Show Modeless
End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,213,543
Messages
6,114,243
Members
448,555
Latest member
RobertJones1986

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top