Creating a new macro directly in the VBA Editor
Note: to be read after the post:
First Look at the VBA Editor
Ok. So we have now seen how to modify a macro created using the ‘Record Macro’ option. What if we want to create a Subroutine without doing any recording. Simplicity itself.
- Open the VBA Editor(Alt-F11)
- Type in the Code required starting with a sub name() and ending with an end sub. We could use the code in the previous article itself.
Sub BIU()
‘
‘ BIU Macro
‘ Macro recorded 10/2/2006 by vr
‘
‘ Keyboard Shortcut: Ctrl+Shift+I
‘
Selection.Font.Bold = True
Selection.Font.Italic = True
Selection.Font.Underline = xlUnderlineStyleSingle
End Sub
You are done!!
Now if you take a look at the associated Excel sheet under ‘Macros’(Alt-F8), you will find a macro with the name you have just given. You may then go to ‘Options’ and add a Shortcut key and Description if you so desire
March 11, 2008 at 9:58 am
$anchor$basketball Betting,final Four,final Four Betting,final Four Gambling,final Four Sports Book,final Four Sportsbook,march Madness,march Madness Betting,march Madness Gambling,march Madness Sports Book,march Madness Sportsbook,ncaa,ncaa Betting,…
$anchor$basketball Betting,final Four,final Four Betting,final Four Gambling,final Four Sports Book,final Four Sportsbook,march Madness,march Madness Betting,march Madness Gambling,march Madness Sports Book,march Madness Sportsbook,ncaa,ncaa Betting,nc…