290 likes | 439 Views
Bullet-Proofing your Excel Spreadsheets. Tech Day 2013 Presentation. Outline. Overview Data Protection Why Use Macros? Enabling Macros, and a Warning Recording a Macro Capturing a Formula in a Macro Resources. Protecting data from errors. Data errors can occur in many ways:
E N D
Bullet-Proofing your Excel Spreadsheets Tech Day 2013 Presentation
Outline • Overview • Data Protection • Why Use Macros? • Enabling Macros, and a Warning • Recording a Macro • Capturing a Formula in a Macro • Resources
Protecting data from errors • 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
Where is it found? Select the cells/rows/columns that you want to validate, then
What is the purpose of macros? • Manipulate data • Apply style and formatting
How would i ever use macros? • Manipulating research data
How would i ever use macros? • Classroom gradebook
How would i ever use macros? If you are repetitively performing the same action in excel, then it is wise to use a macro
Enabling macro creation • To execute or work with macros, you must enable the Developer tab: , then
Enabling macro execution • 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
How do i make a macro? • Open sample excel file
How do i make a macro? • Click on the “Developer” tab or
How do i make a macro? • 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 Dependent on coordinates Relative Reference
How do i make a macro? • If want relative reference click “Relative Reference” • Click “Record”
How do i make a macro? Name your Macro Click “OK” Create shortcut for macro
How do i make a macro? Record your Macro!
How do i make a macro? • Click “Stop” when finished
How do i run my macro? • When open Excel click either • “Macros” • Macros command • (eg. Option + Command + A) “Run”
How would i ever use macros? If you are repetitively performing the same action in excel, then it is wise to use a macro Formulas!!!!
How to create a new formula? Demonstration
How to create a new formula? Function Area(Length As Double, Width As Double) Area = Length * Width End Function
Resources • Tips on Data Validation • http://office.microsoft.com/en-us/excel-help/apply-data-validation-to-cells-HP010072600.aspx • Microsoft Excel Recording Macros • http://office.microsoft.com/en-us/excel-help/overview-RZ102337714.aspx?CTT=1§ion=1 • Excel for Dummies • http://www.dummies.com/how-to/computers-software/ms-office/Excel/Excel-2013/Macros-Programming.html
Resources • Writing Your First VBA Function in Excel • http://www.fontstuff.com/vba/vbatut01.htm • Writing Your Own Functions In VBA • http://www.cpearson.com/excel/writingfunctionsinvba.aspx