WISE OWL EXERCISES
VBA EXERCISES
ADVANCED VBA EXERCISES
Free Advanced VBA exercises
This page lists 33 Advanced VBA exercises. You can use the menu to show just exercises for a specific topic.
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | Class modules |
Level: | Relatively easy |
Course: | Advanced VBA |
Exercise: | Create a class to allow users to run a mortgage model (properties are things like house price and deposit). |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | Revision of VBA |
Level: | Relatively easy |
Course: | Advanced VBA |
Exercise: | Loop over film cells, picking out those films having lots of reviews and colouring them. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | Passing arguments |
Level: | Relatively easy |
Course: | Advanced VBA |
Exercise: | Create a routine to send an Outlook message. The argument list should vary according to whether you are copying the message to anyone. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | FileDialogs |
Level: | Relatively easy |
Course: | Advanced VBA |
Exercise: | Using FileDialogs to create customised file dialog boxes. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | Revision of VBA |
Level: | Relatively easy |
Course: | Advanced VBA |
Exercise: | Write a macro to loop over a number of holidays, getting the details for each and writing these out to the immediate window. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | FileSystemObjects |
Level: | Relatively easy |
Course: | Advanced VBA |
Exercise: | Write a macro which creates a FileSystemObject reference, then uses this to list out all of the Excel workbooks in a folder. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | Links to other applications |
Level: | Relatively easy |
Course: | Advanced VBA |
Exercise: | Create a PowerPoint macro writing slide information for an existing presentation to a new workbook in Excel. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | Working with text files |
Level: | Relatively easy |
Course: | Advanced VBA |
Exercise: | Write a macro to loop over the lines in a text file, reading each in and storing the message. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | Passing arguments |
Level: | Relatively easy |
Course: | Advanced VBA |
Exercise: | Create a couple of simple macros taking arguments - one to display a message, and one to protect or unprotect a worksheet. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | Working with shapes |
Level: | Relatively easy |
Course: | Advanced VBA |
Exercise: | Write a macro to put block arrow shapes into different cells. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | Links to other applications |
Level: | Relatively easy |
Course: | Advanced VBA |
Exercise: | Loop over cells in Excel, copying contents to Word bookmarks to write a letter. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | Revision of VBA |
Level: | Average difficulty |
Course: | Advanced VBA |
Exercise: | An exercise to loop over all of the controls on a form, counting how many there are of each type. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | Linking to data |
Level: | Average difficulty |
Course: | Advanced VBA |
Exercise: | Use ADO in VBA to add data to an Access database from an Excel workbook. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | Class modules |
Level: | Average difficulty |
Course: | Advanced VBA |
Exercise: | An exercise to create a game class, such that when you set the home/away team name and score, an Add method adds the result to a table. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | FileSystemObjects |
Level: | Average difficulty |
Course: | Advanced VBA |
Exercise: | Write a macro to open lots of workbooks in turn, collating the responses from each. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | Working with shapes |
Level: | Average difficulty |
Course: | Advanced VBA |
Exercise: | Write a macro to generate all of the autoshapes in a worksheet. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | Class modules |
Level: | Average difficulty |
Course: | Advanced VBA |
Exercise: | Create a class to allow you to create simple pie charts. The chart has 3 simple properties - title, data range and slice to explode - and one method, print preview. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | FileDialogs |
Level: | Average difficulty |
Course: | Advanced VBA |
Exercise: | Creating a dialog box allowing multiple selection of files. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | Revision of VBA |
Level: | Average difficulty |
Course: | Advanced VBA |
Exercise: | An exercise to loop over collections of characters in a Word paragraph. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | Linking to data |
Level: | Average difficulty |
Course: | Advanced VBA |
Exercise: | Use ADO to extract a table of data from an Access database into a new Excel worksheet. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | Passing arguments |
Level: | Average difficulty |
Course: | Advanced VBA |
Exercise: | Create a function to calculate Olympic medal points - this should take 3 arguments and return a single points total. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | Links to other applications |
Level: | Average difficulty |
Course: | Advanced VBA |
Exercise: | Looping over words in a document, writing each to Excel and counting instances. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | Linking to data |
Level: | Average difficulty |
Course: | Advanced VBA |
Exercise: | Create an input form for Beatles, linking Excel to Access using ADO, then read Beatles back into an array using REDIM PRESERVE. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | Passing arguments |
Level: | Average difficulty |
Course: | Advanced VBA |
Exercise: | An exercise to add records to a database, using an optional argument for the postcode and also showing enumerations. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | Revision of VBA |
Level: | Average difficulty |
Course: | Advanced VBA |
Exercise: | List out the number of shapes on each slide in a presentation, by looping over the slides. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | FileSystemObjects |
Level: | Average difficulty |
Course: | Advanced VBA |
Exercise: | Using FileSystemObjects to move, copy, rename and delete files and folders. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | Working with text files |
Level: | Average difficulty |
Course: | Advanced VBA |
Exercise: | Read in a text file which contains the specification of a house, and colour Excel cells accordingly to draw it. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | Passing arguments |
Level: | Average difficulty |
Course: | Advanced VBA |
Exercise: | Writing a program to calculate the factorial of a number without loopin, using recursive programming. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | Advanced class modules topics |
Level: | Harder than average |
Course: | Advanced VBA |
Exercise: | An exercise to create a Holiday class and a strongly-typed Holidays collection, and test that these work. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | FileSystemObjects |
Level: | Harder than average |
Course: | Advanced VBA |
Exercise: | Consolidate data from files on your computer using file references. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | Links to other applications |
Level: | Harder than average |
Course: | Advanced VBA |
Exercise: | A form with a combo box getting its values from an Access query. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | Passing arguments |
Level: | Harder than average |
Course: | Advanced VBA |
Exercise: | Write a macro to work out Yahoo-style breadcrumbs given a table of regions. Each region record contains the region id and name and the id of the parent region. |
Software: | Advanced VBA |
Version: | Any MS Office versions |
Topic: | Working with shapes |
Level: | Harder than average |
Course: | Advanced VBA |
Exercise: | Draw car shapes using a macro, and use them to simulate a race. |
You can search our full list of VBA exercises here.