Download presentation
Presentation is loading. Please wait.
Published byVincent Barnett Modified over 9 years ago
1
ME 142 Engineering Computation I Macros
2
Key Concepts Macro Overview Recording a Macro Running a Macro Editing a Macro Using Controls
3
Macro Overview
4
A macro is a short program or set of recorded keystrokes Stored as VBA program Great for repetitive tasks Can be edited Great way to learn new VBA functions
5
Recording a Macro
6
Recording of a macros can be launched from the View and Developer tabs or the lower left of the spreadsheet window
7
Recording a Macro Select Use Relative References button, if desired, prior to recording macro
8
Recording a Macro Prior to recording the macro, a dialog box is displayed Note in particular: Shortcut key Storage location
9
Ending a Macro Recording Use the Stop Recording button on from the View or Developer tabs or the lower left of the spreadsheet window
10
Running a Macro
11
Click on Macro from the View or Developer ribbons to list available macros May also use previously assigned shortcut key combination to launch macro
12
Editing a Macro
13
Edit a Macro as you would any VBA program Alternately may launch editor by clicking on Macro in the View or Developer ribbons and selecting Edit
14
Example Problem Convert a temperature from F to C Both F and C temperatures should appear in adjacent cells when the macro is complete
15
Using Controls
16
Form Controls can be used to facilitiate getting input or running a VBA program Example: Button – facilitate running VBA program
17
Using Controls Continued Forms controls can also be used in Excel spreadsheets and custom dialog boxes Today we’ll look at their use directly in a spreadsheet Later will see how they can be used in custom dialog boxes
18
Using Controls Continued Forms controls are available on the Developer tab, under Insert
19
Spin Button Used to increase/decrease the value of a cell May link directly to a cell After placing control, right click to format control
20
Scroll Bar Used to increase/decrease the value of a cell May position either horizontally or vertically by dragging in that direction After placing control, right click to format control
21
Review Questions
22
ReviewQuestion In Excel, a macro is always created as a: A.VBA Sub B.VBA Function C.VBA Macro D.May be either A or B E.None of the above
23
Homework Help ‘n Hints
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.