Download - landscape test 2
![Page 1: landscape test 2](https://reader030.vdocument.in/reader030/viewer/2022020400/568c4dc01a28ab4916a530ae/html5/thumbnails/1.jpg)
CO4001Data Analysis
Modelling 4Automation & catch up
![Page 2: landscape test 2](https://reader030.vdocument.in/reader030/viewer/2022020400/568c4dc01a28ab4916a530ae/html5/thumbnails/2.jpg)
What is a macro? O Small program that runs inside the Excel
application (VBA)O Allows you to:
O Record procedures that take many stepsO Subsequently run them with a keystroke or the
click of a buttonO Alter the procedure by changing the code (if
you want!)
![Page 3: landscape test 2](https://reader030.vdocument.in/reader030/viewer/2022020400/568c4dc01a28ab4916a530ae/html5/thumbnails/3.jpg)
Macro Security O Macro Security
O Enable macros O Disable macrosO Do not Open
![Page 4: landscape test 2](https://reader030.vdocument.in/reader030/viewer/2022020400/568c4dc01a28ab4916a530ae/html5/thumbnails/4.jpg)
To display Developer tab on Ribbon – from File menu
![Page 5: landscape test 2](https://reader030.vdocument.in/reader030/viewer/2022020400/568c4dc01a28ab4916a530ae/html5/thumbnails/5.jpg)
To Set Security Level
![Page 6: landscape test 2](https://reader030.vdocument.in/reader030/viewer/2022020400/568c4dc01a28ab4916a530ae/html5/thumbnails/6.jpg)
Record a Macro Example 1. Plan what you wish to record2. Do it manually to check you know what to do3. For example – using the Countries sheet we
want to sort the countries into EU and non-EU then by Population:1. Highlight required cells A4 to F492. Sort by EU descending3. Sort by Population ascending
4. Check it works (First country in list Luxembourg?)
5. Now sort on Country ascending ready to record
![Page 7: landscape test 2](https://reader030.vdocument.in/reader030/viewer/2022020400/568c4dc01a28ab4916a530ae/html5/thumbnails/7.jpg)
Record a Macro Developer>Record Macro
![Page 8: landscape test 2](https://reader030.vdocument.in/reader030/viewer/2022020400/568c4dc01a28ab4916a530ae/html5/thumbnails/8.jpg)
Run Macro CountrySort
OR CTRL + p
Developer > Macros >Run
![Page 9: landscape test 2](https://reader030.vdocument.in/reader030/viewer/2022020400/568c4dc01a28ab4916a530ae/html5/thumbnails/9.jpg)
Delete a Macro Developer > Macros > Delete
![Page 10: landscape test 2](https://reader030.vdocument.in/reader030/viewer/2022020400/568c4dc01a28ab4916a530ae/html5/thumbnails/10.jpg)
Attaching a Macro to a Button(Form Control)
Buton 1
![Page 11: landscape test 2](https://reader030.vdocument.in/reader030/viewer/2022020400/568c4dc01a28ab4916a530ae/html5/thumbnails/11.jpg)
Assign a macro to a ButtonSelect the relevant Macro > OK
![Page 12: landscape test 2](https://reader030.vdocument.in/reader030/viewer/2022020400/568c4dc01a28ab4916a530ae/html5/thumbnails/12.jpg)
Give the Button a LabelRight-click then Edit Text
![Page 13: landscape test 2](https://reader030.vdocument.in/reader030/viewer/2022020400/568c4dc01a28ab4916a530ae/html5/thumbnails/13.jpg)
Editing Macros Developer>Macros>Edit
![Page 14: landscape test 2](https://reader030.vdocument.in/reader030/viewer/2022020400/568c4dc01a28ab4916a530ae/html5/thumbnails/14.jpg)
VB Macro Code
![Page 15: landscape test 2](https://reader030.vdocument.in/reader030/viewer/2022020400/568c4dc01a28ab4916a530ae/html5/thumbnails/15.jpg)
Hide Sheet TabsFile > Options >Advanced, Scroll to Display options for worksheet, Deselect show sheet tabs, Click ok
![Page 16: landscape test 2](https://reader030.vdocument.in/reader030/viewer/2022020400/568c4dc01a28ab4916a530ae/html5/thumbnails/16.jpg)
Workshop
O Exercise 4.1 CountrySort macroO Exercise 4.2 ViewReport macroO Exercise 4.3 Menu macroO Exercise 4.4 & 4.5 LookupsO Discussion Board contribution