|   Home    |    Excel    |    Access   |   Word   |   Outlook   |   VBA   |   Downloads   |   Index   |
VBA Tips...
Free Courseware

Download FREE courseware handouts. These documents are ideal for teachers, students and anyone wanting to learn more about their Microsoft Office programs. Each handout covers a specific topic and is illustrated with full-colour screenshots. Many have accompanying sample files. The files are not restricted in any way so you can print copies or read them on-screen.
Get my Free Courseware here.


eBooks by Martin Green

Do you want to learn more about Access, Excel and VBA? Are you a teacher looking for top quality courseware for your students? My eBooks are the ideal solution to your needs. They are packed with code snippets, illustrations and step-by-step exercises. Written in the same style as my popular on-line tutorials, my eBooks will help you develop your skills and build useful, professional looking applications. Find out more at my eBooks Page.

Support this site!

Make a small donation to help support this site.

Donate in US Dollars

Donate in UK Pounds

Donate in Euros


VBA Tutorials

VBA (Visual Basic for Applications) is the magic that allows you to get your Office programs doing whatever you want. You can automate tedious procedures, get your different applications to communicate with each other, and build the tools that you wish Microsoft had made. And you don't even have to be a Rocket Scientist!

From simple macros to complex procedures and custom functions... once you start using VBA you will wonder how you ever managed without it.

  • A Pop-up Calendar for Excel (Excel 2007/2010 version)
    This version of my popular tutorial has been updated for Excel 2007 and 2010. In addition to walking you through the steps of building a pop-up calendar it introduces VBA UserForms and tells you everything you need to know to write the associated VBA code. It also shows you how to build the Pop-up Calendar as an Excel Add-In for safe and easy distribution to other users. Ready-made examples of the files are available for free download. See the accompanying video tutorials in my VBA Video Tips section.
    Excel 2007 Excel 2010
  • VBA UserForms: Fill a Combo Box or List Box List from a Database
    This tutorial shows you how to fill a Combo box or List Box list on a UserForm using data in an Access database. The technique uses ADO coding and works from any Microsoft Office program.
  • Build an Automatic Document Template for Word
    Any frequently-used Word document can be saved as a template that creates a fresh copy of the document whenever it is needed. Letters, contracts and other standard documents created from templates usually need modifying in various places before being printed and saved. This 3-part tutorial shows you how to build a VBA UserForm to create a friendly dialog box to automate this process and help the user complete the task.
    Word 97 Word 2000/2002/2003
  • How to Use Your Excel Add-In Functions in VBA
    "I built an Add-In for my custom functions. Why why can't I use them in my workbook code?" Add-Ins are intended primarily to add extra functionality to your workbooks. If you want to be able to use their functions in your VBA code you have to set a reference to the Add-In. This article explains how.
    Excel 97  Excel 2000/2002/2003
  • A Pop-up Calendar for Excel (Excel 97/2000/2002/2003 version)
    Entering dates correctly seems to be a problem for so many people. This tutorial shows how to create a pop-up calendar using the Microsoft ActiveX Calendar Control. Choosing a date from the calendar enters it into the active cell on the worksheet. The tutorial includes automatically assigning a keyboard shortcut, and customizing shortcut menus so that the user can right-click on a cell and ask to insert a date. There's also a ready-made Calendar Add-In to download.
    Excel 97  Excel 2000/2002/2003
  • An Improved Custom Random Numbers Function
    Just when you think you've thought of everything, you realise you need something else! With only minor adjustments to the original, this function allows you to specify a degree of precision (number of decimal places).
    Excel 97  Excel 2000/2002/2003
  • More Custom Functions for Access and Excel
    If you're short of ideas for Custom Functions take a look at these. This tutorial shows you how to build and use RandomNumbers, FindSaturday, EOMonth and RemoveSpaces functions that can be used in both Excel and Access. You will also see examples of If Statements and Case Statements, and some built-in functions that you might not have discovered yet.
    Access 97  Access 2000/2002/2003   Excel 97  Excel 2000/2002/2003
  • Build Custom Functions for Your Access Applications
    If you ever thought that Access was a little short on calculating power, this tutorial is for you. You will learn how to write a Custom function in Access and find out how to make use of it in forms and queries.
    Access 97  Access 2000/2002/2003
  • Build an Excel Add-In
    The Add-In is an ideal tool for storing and distributing your custom functions in Excel. This tutorial is ideal for beginners, taking you step-by-step through writing a custom function, then creating and installing an Add-In. If you are already comfortable with VBA function writing, you can jump straight to the Add-In section.
    Excel 97  Excel 2000/2002/2003
  • Selecting Random Records from an Access Table
    This tutorial uses both VBA and SQL to select records at random from a table and place them into a new table with the aid of VBA's Rnd() function.
    Access 97  Access 2000/2002/2003
  • Writing Your First VBA Function
    This tutorial takes you step-by-step through creating a User Defined Function (UDF) in Excel and shows you some more useful examples. A good starting point for VBA.
    Excel 97  Excel 2000/2002/2003

More VBA Tutorials from my VBA Video Tips section...

  • Build a Pop-up Calendar for Excel - Part 1
    The first of three videos that accompany my popular tutorial A Pop-up Calendar for Excel and is an excellent introduction to working with UserForms in VBA. The entry of dates is always a headache for people who use spreadsheets or databases. How should the date be written and in what format and what was the date of the third Thursday in October last year anyway? The answer is my pop-up calendar. Use a keyboard shortcut or right-click on a cell to ask for the calendar and all you have to do is pick a date. This short introductory video shows you what the calendar will look like and what it can do. [03:36]
  • Build a Pop-up Calendar for Excel - Part 2
    In this second video I show you how to create a UserForm in Excel's Visual Basic Editor. I add a command button and the calendar itself and write the VBA code to make it work, as well as a macro to open the calendar in Excel. [26:55]
  • Build a Pop-up Calendar for Excel - Part 3
    In the final video I enhance the calendar by writing some code to have it synchronise with an existing date, then add code to the workbook that defines a keyboard shortcut and creates a new item on the cell's right-click menu. Finally I convert the project file into an Excel Add-In for safe and easy distribution. [30:40]


^ top