![]()
Excel Programming with VBA Starter
Table of Contents
Excel Programming with VBA Starter
Credits
www.PacktPub.com
Support files, eBooks, discount offers and more
www.PacktLib.PacktPub.com
Why Subscribe?
Free Access for Packt account holders
Excel Programming with VBA Starter
So, what is VBA?
The basic features of VBA
What kind of things can you do with it?
How can you use this technology within your existing projects?
Recording a macro, adding modules, browsing objects, and variables
Recording a macro
Option 1 – Recording a macro from the status bar
Option 2 – Recording from the Developer tab
Executing your code
Saving a workbook containing macros
Adding a module
Browsing objects
Working with variables
The Immediate window
And that's it
Quick start – VBA programming
Working with loops
Method 1 – For-Next loops
Method 2 – For Each-Next Loops
Method 3 – Do-While and Do-Until loops
Dimensioning and instantiating objects
Subroutines and user-defined functions
Subroutines
Functions
Top features you'll want to know about
Enumeration
Classes
External libraries
People and places you should get to know
Official sites
Resources
Articles and tutorials
Community
Blogs
Twitter
About the author
About the reviewers
Index
![]()
Excel Programming with VBA Starter
Copyright © 2012 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: October 2012
Production Reference: 1171012
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-84968-844-4
www.packtpub.com
![]()
Author
Robert Martin
Reviewers
Jan Karel Pieterse
Peter M Taylor
Acquisition Editor
Alex Newbury
Commissioning Editor
Meeta Rajani
Technical Editor
Vrinda Amberkar
Project Coordinator
Shraddha Bagadia
Proofreader
Aaron Nash
Indexer
Hemangini Bari
Production Coordinator
Prachali Bhiwandkar
Cover Work
Prachali Bhiwandkar
Cover Image
Conidon Miranda
![]()
Support files, eBooks, discount offers and more
You might want to visit www.PacktPub.com for support files and downloads related to your book.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at
www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at
<[email protected]> for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
![]()
www.PacktLib.PacktPub.com
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.
- Fully searchable across every book published by Packt
- Copy and paste, print and bookmark content
- On demand and accessible via web browser
![]()
Free Access for Packt account holders
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.
![]()
Excel Programming with VBA Starter
Welcome to Excel VBA Starter. This book has been especially created to provide you with all the information that you need to get up to speed with programming with VBA (Visual Basic for Applications). You will learn the basics of VBA, get started with building your first VBA code, create user-defined functions to work out complex calculations, and see the tricks of the trade when it comes to using VBA with Excel.
This document contains the following sections:
So what is VBA? – find out what VBA actually is, what you can do with it, and why it's so great.
Recording a macro, adding modules, browsing objects, and variables – learn how to record a macro, add modules, browse for objects available in your project, and finally what variables are useful for.
Quick start: VBA programming – this section will get you started on programming with VBA. Here you will learn how to perform some core tasks in VBA. Such tasks include using loops, dimensioning objects, and creating and categorizing User-defined Functions (UDFs).
Top features you need to know about – VBA gives you infinite possibilities when it comes to creating your own solutions. In this section, you will learn some key concepts such as enumeration, classes (defining properties and methods), and referencing external libraries, in particular how to manipulate files and folders.
People and places you should get to know – in this day and age, it is impossible to live without the Internet and it is here ...