Download presentation
Presentation is loading. Please wait.
Published byHillary Hamilton Modified over 9 years ago
1
OV 1 - 1 Copyright © 2011 Element K Content LLC. All rights reserved. Create a Macro with the Macro Recorder Edit a Macro Debug a Macro Customize the Quick Access Toolbar and Hotkeys Working with Macro Security Developing Macros
2
OV 1 - 2 Copyright © 2011 Element K Content LLC. All rights reserved. Object-Oriented Programming Modeled like real-time object Information associated with an object
3
OV 1 - 3 Copyright © 2011 Element K Content LLC. All rights reserved. Sub font2Arial() Cells.Select Selection.Font.Name = "Arial" End Sub Macros Code that accomplishes frequently repeated task Code that accomplishes frequently repeated task Unique macro name
4
OV 1 - 4 Copyright © 2011 Element K Content LLC. All rights reserved. Macro Options
5
OV 1 - 5 Copyright © 2011 Element K Content LLC. All rights reserved. The Macro Recorder Start recording Perform tasks in the worksheet Perform tasks in the worksheet Reusable generated macro code Reusable generated macro code
6
OV 1 - 6 Copyright © 2011 Element K Content LLC. All rights reserved. Personal Macro Workbook Storage location that any Excel workbook can access Storage location that any Excel workbook can access
7
OV 1 - 7 Copyright © 2011 Element K Content LLC. All rights reserved. Visual Basic Editor Standard toolbar Object Browser Code window Project Explorer Project Explorer Properties window Immediate window
8
OV 1 - 8 Copyright © 2011 Element K Content LLC. All rights reserved. Modules Code window displaying macros in Module1 Module1 selected in Project Explorer Module1 selected in Project Explorer
9
OV 1 - 9 Copyright © 2011 Element K Content LLC. All rights reserved. The Modules Folder The Modules folder displayed in Project Explorer
10
OV 1 - 10 Copyright © 2011 Element K Content LLC. All rights reserved. Objects Real-time components used as objects in macros
11
OV 1 - 11 Copyright © 2011 Element K Content LLC. All rights reserved. Properties Components that describe an object
12
OV 1 - 12 Copyright © 2011 Element K Content LLC. All rights reserved. Methods Actions that can be performed on an object
13
OV 1 - 13 Copyright © 2011 Element K Content LLC. All rights reserved. Sub AddTotals() 'A macro that inserts the SUM function at the bottom of a 'column of unknown length. Dim x As Integer 'Declare the Range objects here: Dim myData As Range Dim myTotal As Range For x = 1 To Worksheets.Count Worksheets(x).Select 'Set the data range object: Range("A7").Select Set myData = ActiveCell.CurrentRegion VBA Comments Comments explaining purpose of macro Comments explaining purpose of macro Comment explaining purpose of code Comment explaining purpose of code Apostrophe used to start comment line Apostrophe used to start comment line
14
OV 1 - 14 Copyright © 2011 Element K Content LLC. All rights reserved. The Debugging Process Set up environment Back up Run code with error Determine problem Reset data Execute code line by line to find the error Fix code error Retest to ensure error is fixed
15
OV 1 - 15 Copyright © 2011 Element K Content LLC. All rights reserved. Debugging Tools Tools that start, stop, and reset macro execution Tools that start, stop, and reset macro execution Toggle Breakpoint tool Step tools
16
OV 1 - 16 Copyright © 2011 Element K Content LLC. All rights reserved. Digital Certificates Unique information about the certificate holder Unique information about the certificate holder
17
OV 1 - 17 Copyright © 2011 Element K Content LLC. All rights reserved. Digital Signatures Digitally signed worksheet cannot be edited Signature icon
18
OV 1 - 18 Copyright © 2011 Element K Content LLC. All rights reserved. Macro Security Settings
19
OV 1 - 19 Copyright © 2011 Element K Content LLC. All rights reserved. 1. Do you think that the Macro Recorder is a useful tool? Why or why not? 2. How does the Personal Macro Workbook relate to the creation and use of custom toolbars, buttons, and menus? Reflective Questions
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.