there is a very simple procedure to do this, kindly follow these steps:
STEPS:
Open the document or template where you want this shortcut key functionality.
Record the Macro:
Press Alt + F8 to open the Macros dialog.
If you have vba code:
click on developer tab
click on the record macro and giev a name and saved it.
click on stop recording
go to Macros
click your desired macro
click on edit
write or paste your vba code
ctrl +S
closs all and save.
Assign the Macro to a Shortcut Key:
https://artisthindustani.blogspot.com/2025/08/how-to-use-vba-code-and-assign-macro.html