Excel Programming with VBA Starter

Excel Programming with VBA Starter

Language: English

Pages: 60

ISBN: 1849688443

Format: PDF / Kindle (mobi) / ePub

Get started with programming in Excel using Visual Basic for Applications (VBA)


  • Extend and enhance your Excel spreadsheets using the power of Macros and VBA programming
  • Get to grips with the VBA language to create professional spreadsheets.
  • Follow practical examples to common problems that you will find yourself using time and time again.

In Detail

Do you have repetitive tasks that you would like to get rid of for good? Would you like to integrate Office Applications in order to streamline some of your tasks? Then look no further. This compact book will provide you with the knowledge to get your VBA programming off the ground and up to a comfortable cruising speed.

"Excel Programming with VBA Starter" was born out of the need to have a short, but yet all-encompassing book that would give you a solid foundation in programming with Visual Basic for Applications. This book will enable you to harness the power of VBA in Excel and put it to good use throughout the course of your working day.

Can't find properties and methods of an object? Don't know what a property, method or object is? Covering simple and advanced topics, create powerful, reusable examples such as IO, picking files from within Excel and automatically attaching them to e-mails. Learn and use the concept of encapsulation to condense code into bite-size methods to be easily accessed from within your projects, plus much more.

What you will learn from this book

  • Get started with recording and play macros
  • Learn to use sub routines, with and without arguments
  • Create user-defined functions (UDFs)
  • Work with loops and effectively debug your code
  • Use UDFs to describe arguments, create custom categories and more
  • Reference external libraries and use them in your project
  • Program interaction and sharing with other Office Applications
  • Learn to work with enumeration
  • Use advanced features and work with Windows APIs
  • Create classes and hide away complex code


JS#12 This is a starter guide, covering the basics you need to get up and running as quickly as possible.

Who this book is written for

This book is written for users of Excel who want to speed up and streamline normally arduous tasks for maximum productivity.

Friction: An Ethnography of Global Connection

Privatizing China: Socialism from Afar

Getting Started with Raspberry Pi

Software Engineering: Effective Teaching And Learning Approaches And Practices




















what to expect): Notice that the MyHouse object is dimensioned as a new instance of clsHouse. For now, it only has one property (Address) and its value will be 2 Skinner Street, London. Once you set the address value, you can retrieve it and show it in a message box, as follows: Sub BuildingMyHouse() Dim MyHouse As New clsHouse MyHouse.Address = "2 Skinner Street, London" MsgBox "My house is located at : " & MyHouse.Address Set MyHouse = Nothing End Sub Now, let us suppose we want to retrieve

the code. Similarly, properties refer to the qualities of the object. For example, the Name property can be used to retrieve the name of a worksheet as well as to rename it. Properties can be read-only, write-only, or read-write. If you find that confusing, you can think of it in terms of your own body. For example, Height is a property that tells how tall you are, whereas Grow is a method (think of this method as a growth hormone) that instructs your body to grow. Finally, you can search for

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 service@ packtpub.com 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

Table of Contents 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

random number is not greater than 80 Do While (Not (iMyRandomInteger > 80)) iMyRandomInteger = Int((100 * Rnd) + 1) lLoopCounter = lLoopCounter + 1 Loop ' ' ' Display a message box showing the random value that caused the loop to exit. It also shows the number of times that the loop ocurred before it exited. MsgBox "Loop exited... The exit value is equal to: " & _ iMyRandomInteger & ". Loop was executed " & _ lLoopCounter & " times before exiting.", vbInformation End Sub It is important to

Download sample