Excel VBA Programming For Dummies
Published by: John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030-5774, www.wiley.com
Copyright 2022 by John Wiley & Sons, Inc., Hoboken, New Jersey
Media and software compilation copyright 2012 by John Wiley & Sons, Inc. All rights reserved.
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 permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without the prior written permission of the Publisher. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions
.
Trademarks: Wiley, For Dummies, the Dummies Man logo, Dummies.com, Making Everything Easier, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and may not be used without written permission. Microsoft and Excel are trademarks or registered trademarks of Microsoft Corporation in the United States and other countries. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc. is not associated with any product or vendor mentioned in this book.
LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: WHILE THE PUBLISHER AND AUTHORS HAVE USED THEIR BEST EFFORTS IN PREPARING THIS WORK, THEY MAKE NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CONTENTS OF THIS WORK AND SPECIFICALLY DISCLAIM ALL WARRANTIES, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. NO WARRANTY MAY BE CREATED OR EXTENDED BY SALES REPRESENTATIVES, WRITTEN SALES MATERIALS OR PROMOTIONAL STATEMENTS FOR THIS WORK. THE FACT THAT AN ORGANIZATION, WEBSITE, OR PRODUCT IS REFERRED TO IN THIS WORK AS A CITATION AND/OR POTENTIAL SOURCE OF FURTHER INFORMATION DOES NOT MEAN THAT THE PUBLISHER AND AUTHORS ENDORSE THE INFORMATION OR SERVICES THE ORGANIZATION, WEBSITE, OR PRODUCT MAY PROVIDE OR RECOMMENDATIONS IT MAY MAKE. THIS WORK IS SOLD WITH THE UNDERSTANDING THAT THE PUBLISHER IS NOT ENGAGED IN RENDERING PROFESSIONAL SERVICES. THE ADVICE AND STRATEGIES CONTAINED HEREIN MAY NOT BE SUITABLE FOR YOUR SITUATION. YOU SHOULD CONSULT WITH A SPECIALIST WHERE APPROPRIATE. FURTHER, READERS SHOULD BE AWARE THAT WEBSITES LISTED IN THIS WORK MAY HAVE CHANGED OR DISAPPEARED BETWEEN WHEN THIS WORK WAS WRITTEN AND WHEN IT IS READ. NEITHER THE PUBLISHER NOR AUTHORS SHALL BE LIABLE FOR ANY LOSS OF PROFIT OR ANY OTHER COMMERCIAL DAMAGES, INCLUDING BUT NOT LIMITED TO SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR OTHER DAMAGES.
For general information on our other products and services, please contact our Customer Care Department within the U.S. at 877-762-2974, outside the U.S. at 317-572-3993, or fax 317-572-4002. For technical support, please visit https://hub.wiley.com/community/support/dummies
.
Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with standard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://booksupport.wiley.com
. For more information about Wiley products, visit www.wiley.com
.
Library of Congress Control Number: 2021951691
ISBN 978-1-119-84307-8 (pbk); ISBN 978-1-119-84308-5 (ebk); ISBN 978-1-119-84309-2 (ebk)
Excel VBA Programming For Dummies
To view this book's Cheat Sheet, simply go to www.dummies.com and search for Excel VBA Programming For Dummies Cheat Sheet in the Search box.
Table of Contents
List of Tables
- Chapter 7
- Chapter 9
- Chapter 10
- Chapter 11
- Chapter 12
- Chapter 15
- Chapter 16
- Chapter 17
- Chapter 18
- Chapter 20
List of Illustrations
- Chapter 2
- Chapter 3
- Chapter 4
- Chapter 5
- Chapter 6
- Chapter 7
- Chapter 8
- Chapter 9
- Chapter 10
- Chapter 11
- Chapter 12
- Chapter 13
- Chapter 14
- Chapter 15
- Chapter 16
- Chapter 17
- Chapter 18
- Chapter 19
- Chapter 20
- Chapter 21
- Chapter 22
Guide
Pages
Introduction
Greetings, prospective Excel programmer
You no doubt have your reasons for picking up a book on VBA programming. Maybe you got a new job (congratulations). Maybe youre trying to automate some of the repetitive data crunching tasks you have to do. Maybe youre just a nerd at heart. Whatever the reason, thank you for choosing this book.
Inside, you find everything you need to get up and running with VBA fast. Even if you dont have the foggiest idea of what programming is all about, this book can help. Unlike most programming books, this one is filled with information designed to include just what you need to know to quickly ramp your VBA programming skillset.
About This Book
Go to any large bookstore (in person or online), and youll find many Excel books. A quick overview can help you decide whether this book is really right for you. This book
- Is designed for intermediate to advanced Excel users who want to get up to speed with Visual Basic for Applications (VBA) programming.
- Requires no previous programming experience.
- Covers the most commonly used commands.
- Is appropriate for recent versions of Excel.
- Just might make you crack a smile occasionally.
If youre using an older version of Excel, this book might be okay, but some things have changed. Youd probably be better off with the preceding edition.
Oh, yeah this is not an introductory Excel book. If youre looking for a general-purpose Excel book, check out either of the following books, which are both published by Wiley:
- Excel 2019 For Dummies, by Greg Harvey
- Excel Bible, by Michael Alexander and Dick Kusleika
These books are also available in editions for earlier versions of Excel.
Notice that the title of this book isnt The Complete Guide to Excel VBA Programming For Dummies. This book doesnt cover all aspects of Excel programming but then again, you probably dont want to know everything about this topic.
If you consume this book and find that youre hungry for a more comprehensive Excel programming book, you might try Microsoft Excel 2019 Power Programming with VBA, also published by Wiley. And yes, editions for older versions of Excel are also available.
To make the content more accessible, I divided this book into six parts:
- , Starting with Excel VBA Programming
- , Employing VBA with Excel
- , Programming Concepts
- , Communicating with Your Users
- , Putting It All Together
- , The Part of Tens
Typographical conventions
Sometimes, I refer to key combinations which means you hold down one key while you press another. For example, Ctrl+Z means you hold down the Ctrl key while you press Z.
Next page