text.skipToContent text.skipToNavigation

Introduction to VBA for Excel, 2nd edition

  • Steven C. Chapra

Published by Pearson (June 29th 2009) - Copyright © 2010

2nd edition

Introduction to VBA for Excel

ISBN-13: 9780132396677

Includes: Paperback
Free delivery
$53.32 $66.65

What's included

  • Paperback

    You'll get a bound printed text.

Overview

Learn to program and design user interfaces using Excel 2007.

KEY TOPICS: This introductory text explains how to develop programs using VBA within the Microsoft Excel environment. The text does not assume any previous programming experience. The new edition has been revised to bring it up-to-date with the Office 2007 environment.

MARKET: For students and professionals in General Engineering or Computer Science fields.

Table of contents

Contents

1 If You’ve Never Programmed Before 1

1.1 The “Idea” of a Program 2

1.2 The Concept of Assignment 3

1.3 Decisions and Loops 4

1.3.1 Decisions 5

1.3.2 Loops 5

1.4 A Simple Example 6

 

2 Overview of VBA for Excel 8

2.1 The Excel/VBA Environment 9

2.2 An Excel Interface and a VBA Macro Program 9

2.2.1 Hands-on Exercise: A Simple Addition Program 10

2.3 Other Ways to Obtain and Display Information 16

 

3 Recording Macros 20

3.1 Macro Recording 21

3.1.1 Hands-on Exercise: Macro Recording to Format a Range of Cells 21

3.2 Absolute and Relative References 24

3.2.1 Hands-on Exercise: Absolute versus Relative Recording Mode 24

3.3 Using Macro Recording to Learn about VBA 27

3.3.1 Hands-on Exercise: Using a Macro Recording to Learn How to Count

Data 27

3.4 What Keyboard Macros Can’t Do 29

 

4 Customized Worksheet Functions 31

4.1 The “Idea” of a Function 32

4.2 Worksheet Function Macros 33

4.2.1 Hands-on Exercise: A Simple Worksheet Function Macro 33

 

5 Modular Programming 39

5.1 Sub Procedures 40

5.1.1 Hands-on Exercise: The Kick Calculator 41

5.2 Function Procedures 46

5.3 More about Procedure Arguments 47

5.3.1 Hands-on Exercise: The Behavior of the Parameter List 48

5.4 Passing by Value or by Reference 50

5.4.1 Hands-on Exercise: Passing by Value or by Reference 51

5.5 Static Variables 52

 

6 Object-oriented Programming 55

6.1 Objects, Properties, Methods, and Collections 56

6.1.1 Hands-on Exercise: OOP and a Recorded Macro 57

6.2 Using Oop for Input/Output 61

6.3 Learning More About Oop 62

 

7 Debugging and Testing 65

7.1 Debugging 66

7.2 The VBA Help Facility 66

7.2.1 Help Menu 66

7.2.2 Context-Sensitive Help and the F1 Key 68

7.2.3 Accessing Help from Error Messages 69

7.3 Built-in Debugging Capabilities 69

7.3.1 Passive Debugging: VBA Error Messages 69

7.3.2 Active Debugging 71

7.3.3 Hands-on Exercise: The VBA Debugger 72

7.4 Testing 73

 

8 Data Typing And Variable Scope 76

8.1 Data Types 77

8.1.1 Numeric Information 77

8.1.2 Character, or “String,” Information 79

8.1.3 Logical, or “Boolean,” Information 79

8.2 Type De

For teachers

All the material you need to teach your courses.

Discover teaching material