A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Hi,
For example, we want to assign a shortcut key (Ctrl+B) to the symbol "@" in Excel.
Step 1:
Press Alt+F11 >> Insert >> Module, then paste the following code in the added module.
'#################################
'Callback subroutine when using Ctrl+D.
'#################################
Sub Test()
Application.SendKeys "@"
End Sub
'#############################################
'Register a shortcut key (Ctrl+D) to run the macro Test.
'#############################################
Sub RegisterShortcutKey2Macro()
Application.MacroOptions Macro:="Test", ShortcutKey:="b"
End Sub
Step 2:
Run the macro RegisterShortcutKey2Macro first, and then go back to Sheet1, try to press the registered shortcut key (Ctrl+B), the symbol "@" will show in the active cell.
Cheers,
Cristin