Excel 2007 VBA Programming For Dummies 1st Edition Walkenbach download
Excel 2007 VBA Programming For Dummies 1st Edition Walkenbach download
https://ebookultra.com/download/excel-2007-vba-programming-for-
dummies-1st-edition-walkenbach/
https://ebookultra.com/download/excel-vba-programming-for-
dummies-4e-4th-edition-walkenbach/
https://ebookultra.com/download/excel-2007-for-dummies-quick-
reference-john-walkenbach/
https://ebookultra.com/download/access-2007-vba-programming-for-
dummies-1st-edition-joseph-c-stockman/
https://ebookultra.com/download/excel-2007-for-dummies-1st-edition-
greg-phd-harvey/
Excel Programming with VBA Starter 1st Edition Robert
Martin
https://ebookultra.com/download/excel-programming-with-vba-
starter-1st-edition-robert-martin/
https://ebookultra.com/download/excel-2007-workbook-for-dummies-2nd-
edition-edition-greg-harvey/
https://ebookultra.com/download/excel-2007-data-analysis-for-
dummies-1st-edition-stephen-l-nelson/
https://ebookultra.com/download/excel-2007-vba-programmer-s-reference-
programmer-to-programmer-1st-edition-john-green/
https://ebookultra.com/download/excel-2010-bible-1st-edition-john-
walkenbach/
Excel 2007 VBA Programming For Dummies 1st Edition
Walkenbach Digital Instant Download
Author(s): Walkenbach, John
ISBN(s): 9780470046746, 0470046740
Edition: 1
File Details: PDF, 9.89 MB
Year: 2007
Language: english
www.sharexxx.net - free books & magazines
TEAM LinG
®
Excel 2007 VBA
Programming
FOR
DUMmIES
‰
by John Walkenbach
TEAM LinG
Excel® 2007 VBA Programming For Dummies®
Published by
Wiley Publishing, Inc.
111 River Street
Hoboken, NJ 07030-5774
www.wiley.com
Copyright © 2007 by Wiley Publishing, Inc., Indianapolis, Indiana
Published by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or
by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permit-
ted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written
permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the
Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600.
Requests to the Publisher for permission should be addressed to the Legal Department, Wiley Publishing,
Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4355, or online at
http://www.wiley.com/go/permissions.
Trademarks: Wiley, the Wiley Publishing logo, For Dummies, the Dummies Man logo, A Reference for the
Rest of Us!, The Dummies Way, Dummies Daily, The Fun and Easy Way, Dummies.com, and related trade
dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates in the United
States and other countries, and may not be used without written permission. Microsoft and Excel are reg-
istered trademarks of Microsoft Corporation in the United States and/or other countries. All other trade-
marks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any
product or vendor mentioned in this book.
LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND THE AUTHOR MAKE NO REP-
RESENTATIONS OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CON-
TENTS OF THIS WORK AND SPECIFICALLY DISCLAIM ALL WARRANTIES, INCLUDING WITHOUT
LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE. NO WARRANTY MAY BE CRE-
ATED OR EXTENDED BY SALES OR PROMOTIONAL MATERIALS. THE ADVICE AND STRATEGIES CON-
TAINED HEREIN MAY NOT BE SUITABLE FOR EVERY SITUATION. THIS WORK IS SOLD WITH THE
UNDERSTANDING THAT THE PUBLISHER IS NOT ENGAGED IN RENDERING LEGAL, ACCOUNTING, OR
OTHER PROFESSIONAL SERVICES. IF PROFESSIONAL ASSISTANCE IS REQUIRED, THE SERVICES OF A
COMPETENT PROFESSIONAL PERSON SHOULD BE SOUGHT. NEITHER THE PUBLISHER NOR THE
AUTHOR SHALL BE LIABLE FOR DAMAGES ARISING HEREFROM. THE FACT THAT AN ORGANIZATION
OR WEBSITE IS REFERRED TO IN THIS WORK AS A CITATION AND/OR A POTENTIAL SOURCE OF FUR-
THER INFORMATION DOES NOT MEAN THAT THE AUTHOR OR THE PUBLISHER ENDORSES THE INFOR-
MATION THE ORGANIZATION OR WEBSITE MAY PROVIDE OR RECOMMENDATIONS IT MAY MAKE.
FURTHER, READERS SHOULD BE AWARE THAT INTERNET WEBSITES LISTED IN THIS WORK MAY HAVE
CHANGED OR DISAPPEARED BETWEEN WHEN THIS WORK WAS WRITTEN AND WHEN IT IS READ.
For general information on our other products and services, please contact our Customer Care
Department within the U.S. at 800-762-2974, outside the U.S. at 317-572-3993, or fax 317-572-4002.
For technical support, please visit www.wiley.com/techsupport.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may
not be available in electronic books.
Library of Congress Control Number: 2006939593
ISBN: 978-0-470-04674-6
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
TEAM LinG
About the Author
John Walkenbach is the author of more than 50 spreadsheet books and lives
in southern Arizona. Visit his Web site at http://j-walk.com.
Dedication
“This book is dedicated to Jim Kloss and Esther Golton — my two favorite
people in Matanuska-Susitna county. By putting their names in this book, I’m
ensured of at least one sale in Alaska.”
Author’s Acknowledgments
Thanks to all of the talented people at Wiley Publishing for making it so easy
to write these books. And special thanks to Jan Karel Pieterse for his assis-
tance with this edition.
TEAM LinG
Publisher’s Acknowledgments
We’re proud of this book; please send us your comments through our online registration form
located at www.dummies.com/register/.
Some of the people who helped bring this book to market include the following:
TEAM LinG
Contents at a Glance
Introduction .................................................................1
Part I: Introducing VBA ................................................9
Chapter 1: What Is VBA?..................................................................................................11
Chapter 2: Jumping Right In............................................................................................21
TEAM LinG
Part VI: The Part of Tens ...........................................345
Chapter 22: Ten VBA Questions (And Answers) ........................................................347
Chapter 23: (Almost) Ten Excel Resources.................................................................351
Index .......................................................................355
TEAM LinG
Table of Contents
Introduction..................................................................1
Is This the Right Book?....................................................................................1
So You Want to Be a Programmer . . . ............................................................2
Why Bother? .....................................................................................................2
What I Assume about You ...............................................................................3
Obligatory Typographical Conventions Section ..........................................4
Check Your Security Settings..........................................................................4
How This Book Is Organized...........................................................................6
Part I: Introducing VBA ..........................................................................6
Part II: How VBA Works with Excel ......................................................6
Part III: Programming Concepts............................................................6
Part IV: Communicating with Your Users ............................................6
Part V: Putting It All Together...............................................................7
Part VI: The Part of Tens .......................................................................7
Marginal Icons ..................................................................................................7
Get the Sample Files.........................................................................................8
Now What? ........................................................................................................8
TEAM LinG
viii Excel 2007 VBA Programming For Dummies
TEAM LinG
x Excel 2007 VBA Programming For Dummies
TEAM LinG
Table of Contents xi
Chapter 10: Controlling Program Flow and Making Decisions . . . . .139
Going with the Flow, Dude ..........................................................................139
The GoTo Statement ....................................................................................140
Decisions, decisions...........................................................................141
The If-Then structure .........................................................................141
The Select Case structure .................................................................146
Knocking Your Code for a Loop .................................................................149
For-Next loops.....................................................................................150
Do-While loop .....................................................................................153
Do-Until loop .......................................................................................154
Looping through a Collection .....................................................................155
TEAM LinG
xii Excel 2007 VBA Programming For Dummies
TEAM LinG
Table of Contents xiii
Part IV: Communicating with Your Users.....................221
Chapter 15: Simple Dialog Boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .223
Why Create UserForms?..............................................................................223
The MsgBox Function ..................................................................................224
Displaying a simple message box.....................................................225
Getting a response from a message box..........................................225
Customizing message boxes .............................................................226
The InputBox Function................................................................................229
InputBox syntax..................................................................................229
An InputBox example.........................................................................229
The GetOpenFilename Method...................................................................231
The syntax...........................................................................................232
A GetOpenFilename example............................................................232
Selecting multiple files.......................................................................234
The GetSaveAsFilename Method ...............................................................235
Getting a Folder Name .................................................................................236
Displaying Excel’s Built-in Dialog Boxes....................................................236
TEAM LinG
xiv Excel 2007 VBA Programming For Dummies
Frame control......................................................................................262
Image control ......................................................................................262
Label control .......................................................................................263
ListBox control ...................................................................................264
MultiPage control ...............................................................................265
OptionButton control.........................................................................266
RefEdit control ....................................................................................267
ScrollBar control.................................................................................267
SpinButton control .............................................................................268
TabStrip control..................................................................................269
TextBox control ..................................................................................269
ToggleButton control .........................................................................270
Working with Dialog Box Controls .............................................................270
Moving and resizing controls............................................................270
Aligning and spacing controls ..........................................................271
Accommodating keyboard users......................................................272
Testing a UserForm ............................................................................273
Dialog Box Aesthetics..................................................................................274
TEAM LinG
Random documents with unrelated
content Scribd suggests to you:
THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the
terms of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if you
provide access to or distribute copies of a Project Gutenberg™ work
in a format other than “Plain Vanilla ASCII” or other format used in
the official version posted on the official Project Gutenberg™ website
(www.gutenberg.org), you must, at no additional cost, fee or
expense to the user, provide a copy, a means of exporting a copy, or
a means of obtaining a copy upon request, of the work in its original
“Plain Vanilla ASCII” or other form. Any alternate format must
include the full Project Gutenberg™ License as specified in
paragraph 1.E.1.
• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.
1.F.4. Except for the limited right of replacement or refund set forth
in paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.
Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookultra.com