Go to Tools → Macros → Record Macro, then press the sequence of keystrokes you want. At the end of your sequence click on Stop Recording . In the new window that pops up, give the file a name and save it under My Macros > Standard > Module1.