Run multiple command buttons

jrisebo

Board Regular
Joined
Mar 15, 2011
Messages
235
I have 13 buttons in a spreadsheet that sort data by color. This is to sort our data for each user. So each button is the initials of user. I want it to run the command button of the user that opens it. So, I have figured out how to get the user name, and then using that to assign a cell with the users initials. What I cant figure out is how to program it to run when open.

So in cell A1 I have users initials "AAA". How do I get the spreadsheet to run command button AAA when that user opens it, or run command button BBB when user BBB opens it, and so fourth. All the command buttons are named per the persons initials.

Thanks
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

jrisebo

Board Regular
Joined
Mar 15, 2011
Messages
235
I think I figured it out brute force...

VBA Code:
Select Case ActiveCell.Text
Case Is = "AAA"
Call AAA_Click
End Select
Select Case ActiveCell.Text
Case Is = "BBB"
Call BBB_Click
End Select

and so on. Seems to work.
 

Watch MrExcel Video

Forum statistics

Threads
1,129,568
Messages
5,637,094
Members
416,957
Latest member
Brovashift

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
Top