Before we begin, save your file as MYADVEXCELLESSON01_ and your initials
For me it would be MYADVEXCELLESSON01_ELM.
Save your file as an Excel Macro-Enabled Workbook
(\*xlsm)
YOU NOW HAVE YOUR DEVELOPER RIBBON VISIBLE
Wait!! Before we take off…
Let’s make sure we haven’t overlooked anything…
for example: did you save your file with the
xlsm
extension?
It’s not too late to correct that.
Okay great!! Everything looks good now, right?
Let’s continue.
A screen will pop up. This is your Visual Basic for Applications Editor. Take a good look because this is where you write your code.
You will not write any code in lesson 01 but instead create code and then examine what you created. We will come back to the editor later, but for now I just need you to do a few things -
This is your Visual Basic Editor menu area
Hover that same cute over any unused space within the menu area and Right click your mouse button.
If debug is not checked then Click debug.
Repeat step 6 but this time do the same thing for Edit if Edit does not have a check mark next to it.
Well, you don’t want to leave those things just laying around like that do you? Let’s tuck them in place.
Using your debug menu let’s do step 9
| Here you can find a listing of your macros. From here you can run, step into, edit, create, delete and organize your macros. Don’t worry about the term Step Into. Once you begin coding and chatting with others about coding it will become a part of your vocabulary without you even realizing it. All macros you create will be listed here. Okay you’re probably thinking: “macros in, what is that?” Let’s say you have several workbooks open, you can choose to display the macros for all open workbooks or for a specific workbook. You can also include descriptions to better remember when you go back to them later. Okay we just came here to look around and not actually do anything. Click the Cancel button. |
=======================================
note: First read steps 12 through 27 and then do the actual steps.
Click the button.
The default name Macro1 is highlighted.
Clear the highlighted default name by pressing the BACKSPACE key and then
typing M Y F I R S T M A C R O , Shift- and your initials, for me would be E L M. My full macro name would look like: MYFIRSTMACRO_ELM
In the little box that reads: Shortcut Keys: followed by Ctrl+ type Shift Q.
In the Description box type: This is my first macro for the Advanced Excel VBA class
17. It should look similar to the one below. If so then hit
Select Cell G8.
Type What is your name?.
hit Enter
Select Column G.
Select the Home ribbon.
In the Cells section of the home ribbon. Click Format
From the list Click AutoFit Column Width. (see the picture on the right, or below if you’re viewing this from a mobile device)
Select Cell G9.
Select the Developer ribbon.
Hit the button.
But first…
Hover and
Right Click your over the triangle above the 1 and to the left of the A.
note: (see the diagram to the right, or below if you’re viewing this from a mobile device)
Select Delete.
This starts the sheet back to new. Of course you could right click and select clear contents, but that would not reset the column width.
press Ctrl Shift Q on the keyboard and watch what happens.
Repeat step 28.
select the Developer ribbon.
Click the button.
Click the button.
Make room so that you can see both your code in the Visual Basic Editor and Column G of the spreadsheet.
This is how you visually and comprehensively connect the code with the actions
Go into the Visual Basic Editor and send me a brief description of each of the
buttons“items” on your standard toolbar (contact me if you need help for this task)
note: I mistakenly wrote buttons instead of items so for those who have already turned in their homework and only gave descriptions of the buttons will NOT receive deductions on their score.
note: try to make sure that you can see the whole standard toolbar. If you resize the window it will hide some of the toolbar from view
For Questions and Feedback: earl.montgomery@va.gov
or for a more immediate response: earllamontmontgomery@gmail.com