Using ALT Links in Userforms

Miceal Powell

New Member
Joined
Feb 21, 2025
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi All,
I have seen a few older questions about adding an ALT Key to run a subroutine in an Excel Userform....

here is what I do...

The easiest way to add an "ALT" to a user form is by creating a button that is linked to your subroutine then create a "click" event for that button and assign the desired ALT key in the properties Window (F4) to the "Accelerator" item.

When your form is running ... holding the ALT Key and the Letter you selected will initiate the code.

BTW ... the code in the button you created can just call another subroutine if desired.

I typically hide the button created as I only access to code using the short cut.
 
I'm not an Excel power user so I was wondering why you'd do this when keyboard shortcuts can run macros, so I had to test. Interesting that it seems you can't run code with keyboard shortcuts when a userform has the focus. At least I think that's the reason.
 
Upvote 0

Forum statistics

Threads
1,226,879
Messages
6,193,469
Members
453,802
Latest member
SarahNoob

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