Download presentation
Presentation is loading. Please wait.
Published byHannah Sanders Modified over 9 years ago
1
Visual Basic Is the language for programming in Word, Access,& Excel Is the “Environment” in which the programming is done (called the Integrated Development Environment or IDE)
2
Visual Basic Objects / Properties / Methods Object Property Method Noun Adjective Verb
3
Visual Basic Range (“A3”).select Range is an object select is a method (“A3”) is a modifier for the object Note that object separated from method by a.
4
Activesheet.name Activesheet is an object name is a property Visual Basic The result is the name of the active sheet
5
Visual Basic All objects have properties Most objects have methods Will work with only a few of the many objects, methods and properties Will introduce them as needed
6
Visual Basic Some of the objects Workbook Worksheet ActiveSheet Range Form Chart Note --- a “Cell” is not an object, but is a type of range object
7
Visual Basic And to further confuse the issue objects can have objects as properties And objects can be grouped into collections Workbook = collection of worksheets
8
Visual Basic -- The Environment From Excel --- toggle with alt F11 Notice 3 parts to the IDE The Project area The Properties area The blank (or work area) We will use primarily the properties and work areas
9
Macros are a type of VBA module “Recorded Macros” are exactly that A record of the key strokes converted to VB code
10
Keyboard Macros Quick way to develop a macro Captures keystrokes Assigns a name & shortcut Two places to store Current workbook Personal workbook
11
Current workbook Macro only available in the workbook Stays with the workbook Personal workbook Available to all workbooks you create in current session. Does not travel with current workbook Stored in a special area and needs to be opened.
12
Recorded keystrokes macros, if saved in current workbook, are VBA subprograms in the “modules” component of the IDE. Good way to look at how Excel is manipulated. If saved in the Personal Workbook, will see the Personal Workbook available in the IDE Project window. Are in a module of the Personal workbook
13
Can record macros in two modes: Absolute address mode – referenced cells are absolute addresses (i.e. $col$row) Relative address mode – referenced cells are relative to the selected cell when the macro is recorded. That is, cell addresses may change each time macro is run.
14
We will use recorded macros primarily as a way to introduce VBA programming. But you should be able to find a good use for them – great for repeated tasks. We will develop a couple of macros today and explore VBA more over the next w Labs.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.