Professor Shoemaker There are times in Excel when you have a process that requires several or many steps and that you need to do repeatedly. Excel has a powerful automation feature that lets you automate processes that you need to do repeatedly. Excel 1
Automation can make it easier for you to turn over a spreadsheet you ve created to someone else Simplify the amount they need to learn to take over a worksheet. Practical Tip: You can use automation to get a spreadsheet off your back. The easiest way to use Excel automation is to have Excel record a sequence of your mouse clicks and typing as you preform the task you want to automate. You can then have Excel play back the sequence again and again. Excel 2
A stored sequence of clicks and typing is call a Macro. Macros you record are stored in the workbook. To work, the workbook must be save with the extension.xlsm To be able to use automation you need to go through a few preliminary steps. Click on the File menu then select Options Excel 3
You need to activate the Developer tab on the Ribbon The Developer tab has the features we use for automation. Excel 4
Let s create a macro that just makes some simple changes Once you started the recording, Excel remembers all mouse clicks and typing you do in the workbook Just typing something into an empty cell and change it s formatting. Excel 5
When you done with your sequence of mouse clicks and typing, end the recording of macro Then save your workbook Excel is paranoid about a workbook that has macros Macros can be used introduce a virus onto a computer To help avoid that, Excel blocks all macros when you open a workbook Excel 6
You should never allow a macro to run unless you trust the person who sent you the workbook. For your own workbooks, you can allow macros to run without hassle. When you open a workbook with macros, you can unblock them. Excel 7
You can permanently unblock macros This is convenient but risky From the File menu, select Options In the Trust Center select Trust Center Settings Excel 8
Enable all Macros Click on File then Export Make a Macro to do this Excel 9
Now that we have a macro that will add new fruit to the end of the list We can add a button on the form to run the macro Excel 10
Excel 11
Right-Click on the Button Excel 12
What are the exact steps to add the Pear to the bottom of the list of fruit? Note that cell B3 is named Fruit Keystroke or Mouse Click Explanation 1 Click on D2 Start at the top of the list 2 Click on Use Relative Cell references on the Developer Ribbon Allows the following steps to handle a list of any length 3 Press Ctrl + Down Arrow Moves the cursor to the last entery in the list. 4 Down Arrow one cell Moves the cursor to the first blank cell after the end of the list 5 Enter =Fruit and press Enter Makes a reference to the fruit to be added to the list 6 Click back into the new cell and press Ctrl + C to copy Put the fruit in the Clipboard Continued on the next page Excel 13
Keystroke or Mouse Click Explanation 7 Paste Value into new cell Pastes the name of the fruit in the cell, replacing the reference 8 Press Esc to stop the jaggies Neaten things up 9 Onthe Home tab put an Outside Make the cell look like the others in the list Border around the cell 10 Click on Relative Cell references on the Developer Ribbon Goes back to absolute references so the next step gets the correct cell 11 Click into B3 and press Del to clear the cell Get ready for the next word to be entered That ends the sequence. If you re recording the macro click on Stop Recording and save the workbook. Start recording the Macro If you mess up the steps while you re recording you can Try to keep going or Stop Recording, delete the macro and start over Excel 14
Draw the button on the worksheet Excel 15
Assign the button to the AddToFruitList macro Click in the button and change its caption You can change the button later by right clicking on it. Try it out Excel 16
You can use Excel s Macros feature to automate repetitive tasks. Allows you to simplify the use of a workbook when you turn them over to others to use. Can help you get rid of a workbook Excel 17