Introduction to VBA for Excel / Edition 2

Paperback (Print)
Rent
Rent from BN.com
$19.69
(Save 67%)
Est. Return Date: 09/12/2014
Buy Used
Buy Used from BN.com
$38.62
(Save 34%)
Item is in good condition but packaging may have signs of shelf wear/aging or torn packaging.
Condition: Used – Good details
Used and New from Other Sellers
Used and New from Other Sellers
from $35.65
Usually ships in 1-2 business days
(Save 39%)
Other sellers (Paperback)
  • All (18) from $35.65   
  • New (7) from $47.65   
  • Used (11) from $35.65   

Overview

Learn to program and design user interfaces using Excel 2007.

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.

Read More Show Less

Product Details

  • ISBN-13: 9780132396677
  • Publisher: Prentice Hall
  • Publication date: 7/13/2009
  • Series: ESource: the Prentice Hall Engineering Source Series
  • Edition description: New Edition
  • Edition number: 2
  • Pages: 216
  • Sales rank: 433,473
  • Product dimensions: 7.90 (w) x 9.90 (h) x 0.50 (d)

Meet the Author

Steven C. Chapra presently holds the Louis Berger Chair for Computing and Engineering in the Civil and Environmental Engineering Department at Tufts University. Dr. Chapra received engineering degrees from Manhattan College and the University of Michigan. Before joining the faculty at Tufts, he taught at Texas A&M University, the University of Colorado, and Imperial College, London. His research interests focus on surface water-quality modeling and advanced computer applications in environmental engineering. He has published over 50 refereed journal articles, 20 software packages and 6 books. He has received a number of awards including the 1987 ASEE Merriam/Wiley Distinguished Author Award, the 1993 Rudolph Hering Medal, and teaching awards from Texas A&M, the University of Colorado, and the Association of Environmental Engineering and Science Professors.

Read More Show Less

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 Declaration 80

8.2.1 Variant Data Type 80

8.2.2 The Dim Statement 81

8.2.3 Option Explicit 82

8.2.4 Hands-on Exercise: Run Time for Single and Double Precision 83

8.2.5 Type Declaration Characters 84

8.2.6 The Const Statement 85

8.3 Variable Scope and Lifetime 85

8.3.1 The Parameter List 86

8.3.2 Scope and Declaration 87

9 Computations 90

9.1 Computations 91

9.1.1 Operator Priority 91

9.1.2 Left to Right 92

9.2 Built-in Numeric Functions 93

9.2.1 Accessing Excel Functions from VBA 94

10 Strings and Dialog Boxes 99

10.1 String Functions and Manipulations 100

10.1.1 Concatenating and Parsing Strings 100

10.1.2 LCase and UCase 101

10.2 Message Boxes 103

10.2.1 Buttons 105

10.3 Input Boxes 107

10.3.1 Hands-on Exercise: Data Typing, String Functions, and Input Boxes 108

11 Structured Programming: Decisions 113

11.1 Structured Programming 114

11.2 Flowcharts 115

11.3 The If/Then/Else Decision Structure 116

11.3.1 Indentation 117

11.3.2 Single Decision Structure (If/Then) 118

11.3.3 Single-Line If Statement 119

11.4 If/Then/Elseif Structure 120

11.5 Select Case Structure 121

11.5.1 If/Then/ElseIf Versus Select Case 122

11.6 Nesting 123

11.7 Compound Logical Expressions 125

11.7.1 Logical Complements and DeMorgan’s Theorem 128

12 Structured Programming: Loops 133

12.1 Decision Loops (Do/if Exit) 134

12.2 Count-controlled Loops 135

12.3 Nesting of Loops and Decisions 138

12.4 Recursion 139

12.4.1 Hands-on Exercise: Nonrecursive and Recursive Factorial Functions 140

13 Data Structures: Arrays and Records 147

13.1 Arrays 148

13.1.1 Hands-on Exercise: Loops and Arrays 150

13.1.2 Multidimensional Arrays 152

13.1.3 Changing an Array’s Lower Bound 153

13.1.4 Passing Arrays to Procedures 153

13.1.5 Hands-on Exercise: The Bubble Sort 155

13.1.6 Dynamic Arrays and the ReDim Statement 157

13.2 Records 158

14 Creating and Accessing Files 164

14.1 Sequential Files 165

14.1.1 Hands-on Exercise: File Manipulations 167

14.2 Other File Operations 170

14.2.1 GetOpenFilename Method 170

14.2.2 GetSaveAsFilename Method 172

15 Custom Dialogue Boxes 175

15.1 A Simple Custom Dialogue Box 176

15.1.1 Hands-on Exercise: Developing a Simple Custom Dialogue Box 176

15.2 Custom Dialogue Boxes and Modules 183

15.2.1 Hands-on Exercise: Custom Dialogue Box and Modules 183

References 188

Index 189

Read More Show Less

Preface

Esource—The Prentice Hall Engineering Source—
prenhall.com/esource

Esource—The Prentice Hall Engineering Source gives professors the power to harness the full potential of their text and their first-year engineering course. More than just a collection of books, ESource is a unique publishing system revolving around the ESource website—. ESource enables you to put your stamp on your book just as you do your course. It lets you:

Control. You choose exactly what chapter or sections are in your book and in what order they appear. Of course, you can choose the entire book if you'd like and stay with the authors' original order.
Optimize. Get the most from your book and your course. ESource lets you produce the optimal text for your students needs.
Customize. You can add your own material anywhere in your text's presentation, and your final product will arrive at your bookstore as a professionally formatted text. Of course, all titles in this series are available as stand-alone texts, or as bundles of two or more books sold at a discount. Contact your PH sales rep for discount information.

Read More Show Less

Introduction

Esource--The Prentice Hall Engineering Source--
prenhall.com/esource

Esource--The Prentice Hall Engineering Source gives professors the power to harness the full potential of their text and their first-year engineering course. More than just a collection of books, ESource is a unique publishing system revolving around the ESource website--prenhall.com/esource. ESource enables you to put your stamp on your book just as you do your course. It lets you:

Control. You choose exactly what chapter or sections are in your book and in what order they appear. Of course, you can choose the entire book if you'd like and stay with the authors' original order.
Optimize. Get the most from your book and your course. ESource lets you produce the optimal text for your students needs.
Customize. You can add your own material anywhere in your text's presentation, and your final product will arrive at your bookstore as a professionally formatted text. Of course, all titles in this series are available as stand-alone texts, or as bundles of two or more books sold at a discount. Contact your PH sales rep for discount information.

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)