Bullet-Proofing your Excel Spreadsheets Tech Day 2013 Presentation
Overview Data Protection Why Use Macros? Enabling Macros, and a Warning Recording a Macro Capturing a Formula in a Macro Resources Tech Day 11/20132
Data errors can occur in many ways: – manual entry – data from external sources – data transmission errors We can make better decisions if we can detect and prevent invalid data In Excel, this is called Data Validation Tech Day 12/20133
4 Select the cells/rows/columns that you want to validate, then
Tech Day 12/20135
Manipulate data Apply style and formatting Tech Day 12/20136
Manipulating research data Tech Day 11/20137
Classroom gradebook Tech Day 12/20138
9
To execute or work with macros, you must enable the Developer tab:, then Tech Day 12/201310
Most Excel installations have macro execution disabled by default Be careful if you enable macro execution – you are allowing code to run on your computer Tech Day 12/201311
Open sample excel file Tech Day 11/201312
Click on the “Developer” tab Tech Day 12/ or
Do you need your macro to be dependent upon coordinates, or relative? – Dependent upon coordinates – only works in coordinates recorded – Relative – dependent upon where cursor is Tech Day 12/ Dependent on coordinates Relative Reference
If want relative reference click “Relative Reference” Click “Record” Tech Day 12/201315
Tech Day 12/ Name your Macro Create shortcut for macro Click “OK”
Tech Day 12/201317
Click “Stop” when finished Tech Day 12/201318
When open Excel click either – “Macros” – Macros command (eg. Option + Command + A) Tech Day 12/ “Run”
Tech Day 11/201320
Tech Day 11/201321
Tech Day 11/201322
Tech Day 11/201323
Tech Day 11/201324
Tech Day 11/201325
Tech Day 11/201326
Tech Day 11/ Function Area(Length As Double, Width As Double) Area = Length * Width End Function
Tips on Data Validation – data-validation-to-cells-HP aspx data-validation-to-cells-HP aspx Microsoft Excel Recording Macros – help/overview-RZ aspx?CTT=1§ion=1 help/overview-RZ aspx?CTT=1§ion=1 Excel for Dummies – software/ms-office/Excel/Excel-2013/Macros- Programming.html software/ms-office/Excel/Excel-2013/Macros- Programming.html Tech Day 12/201328
Writing Your First VBA Function in Excel – Writing Your Own Functions In VBA – nvba.aspx nvba.aspx Tech Day 11/201329