Buy New

or
Sign in to turn on 1-Click ordering.
or
Amazon Prime Free Trial required. Sign up when you check out. Learn More
Buy Used
Used - Good See details
$19.93 & eligible for FREE Super Saver Shipping on orders over $25. Details

or
Sign in to turn on 1-Click ordering.
 
   
Sell Back Your Copy
For a $11.18 Gift Card
Trade in
More Buying Choices
Have one to sell? Sell yours here
VBA and Macros for Microsoft Office Excel 2007
 
 
Tell the Publisher!
I'd like to read this book on Kindle

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

VBA and Macros for Microsoft Office Excel 2007 [Paperback]

Bill Jelen (Author), Tracy Syrstad (Author)
4.2 out of 5 stars  See all reviews (8 customer reviews)

List Price: $39.99
Price: $23.45 & eligible for FREE Super Saver Shipping on orders over $25. Details
You Save: $16.54 (41%)
  Special Offers Available
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
In Stock.
Ships from and sold by Amazon.com. Gift-wrap available.
Want it delivered Wednesday, February 1? Choose One-Day Shipping at checkout. Details
Textbook Student FREE Two-Day Shipping for Students. Learn more

Sell Back Your Copy for $11.18
Whether you buy it used on Amazon for $18.75 or somewhere else, you can sell it back through our Book Trade-In Program at the current price of $11.18.
Used Price$18.75
Trade-in Price$11.18
Price after
Trade-in
$7.57

Book Description

0789736829 978-0789736826 August 19, 2007 1

“In this day and age of ‘too much information and not enough time,’ the ability to get to the bottom line quickly and in a concise method is what excels companies to the top of their industry. The techniques in this book will allow you to do things you only dreamt of.”

—Jerry Kohl, president of Brighton Collectibles

 

Develop your Excel macro programming skills using VBA instantly with proven techniques

 

Automate Reports

Handle Errors

Master Pivot Tables

Produce Charts

Build User-Defined Functions

Migrate to Excel 2007

Query Web Data

Build Dialog Boxes

Use Data Visualizations

Automate Word

 

 

You are an expert in Excel, but the macro recorder doesn’t work and you can’t make heads or tails out of the recorded code. If this is you, buy this book. Macros that you record today might work today but not tomorrow. Recorded macros might handle a dataset with 14 records but not one with 12 or 16 records. These are all common problems with the macro recorder that unfortunately cause too many Excel gurus to turn away from writing macros. This book shows you why the macro recorder fails and the steps needed to convert recorded code into code that will work every day with every dataset. The book assumes that you know Excel well, but there is no need for prior programming experience. This book describes everything you could conceivably need to know to automate reports and design applications in Excel VBA. Whether you want to automate reports for your office or design full-blown applications for others, this book is for you.

  • Learn VBA syntax as easy-to-understand English
  • Automate Excel’s power tools: Pivot Tables, Charts, Advanced Filters
  • Save hours per week by automating redundant tasks
  • Create applications built on top of Excel with custom dialog boxes
  • Automatically produce hundreds of Excel reports in seconds
  • Understand how changes in Excel 2007 impact your VBA macros

Introduction   1

1 Unleash the Power of Excel with VBA      7

2 This Sounds Like BASIC, So Why Doesn’t It Look Familiar?       29

3 Referring to Ranges 61

4 User-Defined Functions     75

5 Looping and Flow Control   101

6 R1C1-Style Formulas        121

7 What’s New in Excel 2007 and What's Changed  135

8 Create and Manipulate Names in VBA      143

9 Event Programming 155

10 UserForms--An Introduction       177

11 Creating Charts    197

12 Data Mining with Advanced Filter          249

13 Using VBA to Create Pivot Tables         281

14 Excel Power         337

15 Data Visualizations and Conditional Formatting  373

16 Reading from and Writing to the Web              393

17 XML in Excel 2007 413

18 Automating Word  421

19 Arrays       441

20 Text File Processing    449

21 Using Access as a Back End to Enhance Multi-User Access to Data   461

22 Creating Classes, Records, and Collections       477

23 Advanced UserForm Techniques  493

24 Windows Application Programming Interface (API)       517

25 Handling Errors     529

26 Customizing the Ribbon to Run Macros   543

27 Creating Add-Ins  569

Index  577

 


Special Offers and Product Promotions

  • Buy $50 in qualifying physical textbooks, get $5 in Amazon MP3 Credit. Here's how (restrictions apply)

Frequently Bought Together

VBA and Macros for Microsoft Office Excel 2007 + Excel 2007 Power Programming with VBA (Mr. Spreadsheet's Bookshelf) + Excel 2007 VBA Programming For Dummies
Price For All Three: $66.19

Show availability and shipping details

Buy the selected items together
  • In Stock.
    Ships from and sold by Amazon.com.
    Eligible for FREE Super Saver Shipping on orders over $25. Details

  • Excel 2007 Power Programming with VBA (Mr. Spreadsheet's Bookshelf) $26.25

    In Stock.
    Ships from and sold by Amazon.com.
    This item ships for FREE with Super Saver Shipping. Details

  • Excel 2007 VBA Programming For Dummies $16.49

    In Stock.
    Ships from and sold by Amazon.com.
    Eligible for FREE Super Saver Shipping on orders over $25. Details



Editorial Reviews

About the Author

Bill Jelen, Excel MVP and MrExcel, has been using spreadsheets since 1985, and he launched the MrExcel.com website in 1998. Bill has made more than 50 guest appearances on Call for Help with Leo Laporte and has produced more than 250 episodes of his daily video podcast, Learn Excel from MrExcel. He is the host of Total Training’s Excel 2007 Advanced DVD. He also enjoys taking his show on the road, doing a one- to four-hour power Excel seminar anywhere that a room full of accountants or Excellers will show up. Before founding MrExcel.com, Jelen spent 12 years in the trenches–working as a financial analyst for finance, marketing, accounting, and operations departments of a $500 million public company. He lives near Akron, Ohio, with his wife, Mary Ellen, and sons, Josh and Zeke.

 

Tracy Syrstad remembers the painful trek up the VBA learning curve while developing applications for herself and co-workers at a former job. Now, as the project manager for the MrExcel consulting team, she enjoys helping clients develop custom solutions for their unique situations, observing the myriad ways people use Excel and other Microsoft Office applications.

Excerpt. © Reprinted by permission. All rights reserved.

Introduction

Introduction

In this introduction

  • Getting Results with VBA

  • What Is in This Book

  • The Future of VBA and Windows Versions of Excel

  • Special Elements and Typographical Conventions

  • Code Files

  • Next Steps

Getting Results with VBA

As corporate IT departments have found themselves with long backlogs of requests, Excel users have found that they can produce the reports needed to run their business themselves using the macro language Visual Basic for Applications (VBA). VBA enables you to achieve tremendous efficiencies in your day-to-day use of Excel. This is both a good and bad thing. On the good side, without waiting for resources from IT, you've probably been able to figure out how to import data and produce reports in Excel. On the bad side, you are now stuck importing data and producing reports in Excel.

What Is in This Book

You've taken the right step by purchasing this book. I can help you get up the learning curve so that you can write your own VBA macros and put an end to the burden of generating reports manually.

Getting Up the Learning Curve

This introduction provides a brief history of spreadsheets. Chapter 1 introduces the tools and confirms what you probably already know: The macro recorder does not work. Chapter 2 helps you understand the crazy syntax of VBA. Chapter 3 breaks the code on how to efficiently work with ranges and cells.

By the time you get to Chapter 4, you will know enough to put to immediate use the 25 sample user-defined functions in that chapter.

Chapter 5 covers the power of looping using VBA. In Valerie's case study, after we wrote the program to produce the first department report, it took only another minute to wrap that report routine in a loop that produced all 46 reports.

Chapter 6 covers R1C1-style formulas. Chapter 7 takes a look at what changed in Excel VBA from Excel 2003 to Excel 2007. In the past, it was fairly easy to create VBA code that would run on any of the recent versions of Excel. Unfortunately, with the sweeping changes in Excel 2007, this will become significantly more difficult. Chapter 8 covers names. Chapter 9 has some great tricks that use event programming. Chapter 10 introduces custom dialog boxes that you can use to collect information from the human using Excel.

Excel VBA Power

Chapters 11 through 13 provide an in-depth look at charting, Advanced Filter, and pivot tables. Any report automation tool is going to rely heavily on these concepts.

Chapter 14 includes another 25 code samples designed to exhibit the power of Excel VBA.

Chapters 15 through 18 handle data visualizations, Web queries, XML, and automating another Office program such as Word.

The Techie Stuff Needed to Produce Applications for Others

Chapter 19 shows you how to use arrays to build fast applications. Chapters 20 and 21 handle reading and writing to text files and Access databases. The techniques for using Access databases enable you to build an application with the multi-user features of Access yet keep the friendly front end of Excel.

Chapter 22 covers VBA from the point of view of a Visual Basic programmer. It teaches you about classes and collections. Chapter 23 discusses advanced userform topics. Chapter 24 teaches you some tricky ways to achieve tasks using the Windows application programming interface. Chapters 25 through 27 deal with error handling, custom menus, and add-ins.

Does This Book Teach Excel?

Microsoft believes the average Office user touches only 10 percent of the features in Office. I realize everyone reading this book is above average. I think that I have a pretty smart audience at MrExcel.com. A poll of 8,000 MrExcel.com readers shows that only 42 percent of smarter-than-average users are using any one of the top 10 power features in Excel. I regularly do a Power Excel seminar for accountants. These are hard-core Excelers who use Excel 30 to 40 hours every week. Again, two things come out in every seminar. First, half the audience gasps when they see how quickly you can do tasks with a particular feature (such as automatic subtotals or pivot tables). Second, I am routinely trumped by someone in the audience. Someone will ask a question, I will answer, and someone in the second row will raise a hand and give a better answer. The point? You and I both really know a lot about Excel. However, I will assume that in any given chapter, maybe 58 percent of the people haven't used pivot tables before and maybe even less have used the "Top 10 Filter" feature of pivot tables. Before I show you how to automate something in VBA, I briefly cover how to do the same task in the Excel interface. This book does not teach you how to do pivot tables, but it does alert you that you might want to go explore something and learn it elsewhere.


Monthly Accounting Reports

This is a true story. Valerie is a business analyst in the accounting department of a medium-size corporation. Her company recently installed an overbudget $16 million ERP system. As the project ground to a close, there were no resources left in the IT budget to produce the monthly report that this corporation used to summarize each department.

Valerie, however, had been close enough to the implementation process to think of a way to produce the report herself. She understood that she could export General Ledger data from the ERP system to a text file with comma-separated values. Using Excel, Valerie was able to import the G/L data from the ERP system into Excel.

Creating the report was not easy. Like many companies, there were exceptions in the data. Valerie knew that certain accounts in one particular cost center needed to be reclassed as an expense. She knew that other accounts needed to be excluded from the report entirely. Working carefully in Excel, Valerie made these adjustments. She created one pivot table to produce the first summary section of the report. She cut the pivot table results and pasted them into a blank worksheet. Then she created a new pivot table report for the second section of the summary. After about three hours, she had imported the data, produced five pivot tables, arranged them in a summary, and had neatly formatted the report in color.

Becoming the Hero

Valerie handed this report to her manager. The manager had just heard from the IT department that it would be months before they could get around to producing "that convoluted report." Valerie walked in, handed the Excel report over, and became the instant hero of the day. In three hours, Valerie had managed to do the impossible. Valerie was on cloud nine after a well-deserved "atta-girl."

More Cheers

The next day, this manager attended the monthly department meeting. When the department managers started complaining that they couldn't get the report from the ERP system, this manager pulled out his department report and placed it on the table. The other managers were amazed. How was he able to produce this report? Everyone was greatly relieved to hear that someone had cracked the code. The company president asked Valerie's manager if he could have the report produced for each department.

The Cheers Turn to Dread

You can certainly see this coming. This particular company had 46 departments. That means 46 one-page summaries had to be produced once a month. Each required importing data from the ERP system, backing out certain accounts, producing five pivot tables, and then formatting in color. It had taken Valerie three hours to produce the first report. She found that after she got into the swing of things, she was able to produce the 46 reports in 40 hours. This is horrible. Valerie had a job to do before she won the responsibility of spending 40 hours a month producing these reports in Excel.

VBA to the Rescue

Valerie found my company, MrExcel Consu...


Product Details

  • Paperback: 624 pages
  • Publisher: Que; 1 edition (August 19, 2007)
  • Language: English
  • ISBN-10: 0789736829
  • ISBN-13: 978-0789736826
  • Product Dimensions: 9.2 x 7.1 x 1.3 inches
  • Shipping Weight: 2.2 pounds (View shipping rates and policies)
  • Average Customer Review: 4.2 out of 5 stars  See all reviews (8 customer reviews)
  • Amazon Best Sellers Rank: #91,144 in Books (See Top 100 in Books)

More About the Author

I spent twelve years 'in the trenches', working as a financial analyst for finance, accounting, marketing and operations departments of a $500 million company. Armed with a half-rate reporting tool and a spreadsheet, I was responsible for turning large amounts of data into analyses for the board room quickly and accurately. Working originally in Lotus 1-2-3 and then Microsoft Excel, I honed techniques to take massive amounts of data and produce meaningful reports in record time. These techniques are spelled out in Guerilla Data Analysis Using Microsoft Excel.

In 1998, I launched MrExcel.com, which is now one of the three most popular Excel websites with 21 million annual page views. Being MrExcel is now my full-time gig. My team has developed custom applications for hundreds of clients around the world. I enjoy entertaining a room full of accountants with my 'Power Excel' seminar.

When I am not Excelling, you can find me and the family under the stars enjoying a movie at one of the many drive-in theaters that still dot northeast Ohio or kayaking on the Mogadore Resevoir.

 

Customer Reviews

8 Reviews
5 star:
 (3)
4 star:
 (4)
3 star:
 (1)
2 star:    (0)
1 star:    (0)
 
 
 
 
 
Average Customer Review
4.2 out of 5 stars (8 customer reviews)
 
 
 
 
Share your thoughts with other customers:
Most Helpful Customer Reviews

19 of 20 people found the following review helpful:
4.0 out of 5 stars Excellent Excel/VBA resource, October 7, 2007
This review is from: VBA and Macros for Microsoft Office Excel 2007 (Paperback)
This book was very helpful for some projects that I needed to accomplish with Excel & VBA. Some of the chapters were extremely enlightening in seeing the big picture of using VBA with Excel and other MS Office applications. Other chapters are excellent resources that I will refer to many times in the future. I would recommend this book for both the beginner (in using VBA) as well as the experienced VBA user.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


13 of 14 people found the following review helpful:
3.0 out of 5 stars Just adequate, December 11, 2009
By 
This review is from: VBA and Macros for Microsoft Office Excel 2007 (Paperback)
I find the book simply adequate.

I spent a while looking through books on VBA for Excel 2007 and I chose the Jelen/Syrstad title because is was not one of big fat programming guides. I feel there aren't enough examples provided in the book and the examples from their website are mostly a repeat of the book. I find working with Excel to develop a automatic report a daunting task; the built-in help is nearly worthless, the on-line help is a hit or miss, and that's after I've looked through the book.

I guess I'll be looking for a big fat programming guide with more chart development and, hopefully, one that covers Data Connections and SQL.

I have carefully read through the first 12 chapters before I started my project and I find the information easy to understand and straight forward. If, however, one tries to develop code outside of the examples provided, the frustration level increases.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


8 of 9 people found the following review helpful:
4.0 out of 5 stars VBA and Macros for Excell 2007, September 12, 2009
By 
This review is from: VBA and Macros for Microsoft Office Excel 2007 (Paperback)
I've really enjoyed this book. I had a very basic understanding of VBA prior to purchasing this book; and while I certainly wouldn't consider myself an advanced user at this point, the book has been wonderful at explaining the syntax of code. Unfortunately I haven't had a chance to sit down and read the book all the way through. If I had, I believe I would be a better programmer for having done it. Mainly, I use the book for reference when I'm coding macros at work. The book is laid out well so when I run into an issue it's easy to flip to the index and find roughly what I'm looking for. The online component of the book is nice as well - adding even further resources to users. Overall, I would recommend the book to anyone looking to learn more about VBA or to those simply wanting a reference guide.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No

Share your thoughts with other customers: Create your own review
 
 
 
Most Recent Customer Reviews






Only search this product's reviews



Inside This Book (learn more)
Key Phrases - Statistically Improbable Phrases (SIPs): (learn more)
field list, data labels, object library, event programming, trusted locations, row labels, print area, keyboard shortcut, column data format, workbook events, cell comments, plot area, true space, customui folder, prior pivot tables, nontypeable character, same userform, how many unique customers, default action from taking place, embedded chart events, xlsm file, lary dog, pivot cache, userform code, code workbook
Key Phrases - Capitalized Phrases (CAPs): (learn more)
Private Sub, Advanced Filter, Select Selection, Cancel As Boolean, End Sub, Add Type, Target As Range, Nothing Set, End If Next, Sum of Revenue, Axis Titles, Copy Destination, True Set, Object Browser, Global Const, Data Mining, Guarded Kettle Corporation, Customizing the Ribbon, Clear Next, Excel Power, Excel Options, Grand Total, Microsoft Excel, Select Range, Unleash the Power of Excel
New!
Concordance | Text Stats
Browse Sample Pages:
Front Cover | Table of Contents | First Pages | Index | Back Cover | Surprise Me!
Search Inside This Book:

What Other Items Do Customers Buy After Viewing This Item?


Tags Customers Associate with This Product

 (What's this?)
Click on a tag to find related items, discussions, and people.
 
(4)

Your tags: Add your first tag
 

Sell a Digital Version of This Book in the Kindle Store

If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more

Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
 


Active discussions in related forums
Search Customer Discussions
Search all Amazon discussions
   
Related forums


Listmania!


Create a Listmania! list

So You'd Like to...


Create a guide


Look for Similar Items by Category


Look for Similar Items by Subject