What can you learn here?

  • Get started
  • Short code snippets
  • Abbreviated explanations

Quick examples Get it now

This articles on this site are largely about how to do quite big projects. Realizing that you may have ended up here because you want a small snippet that shows how to do something, this section is dedicated to small snippets to get you started on a particular topic, with just a short explanation given. But if you are really just beginning, read Getting started with VBA first.

 

Getting started series

Here are  series of snippets showing how to ‘get started’ with a series of fundamental VBA topics

Asynchronicity and Scheduling
What can you learn here? TimersScheduling tasksProgress bars Dealing with asynchronous eventsVBA has Event Processing capabilities. This is how it ...
Read More
Clean up Pivot Cache
What can you learn here? Space used by pivot cacheMatch cache to pivotsClear out cache errors Using Pivot CachesExcel Introduced ...
Read More
Formatting range addresses
What can you learn here? Easy format for debuggingRemove dollars for fillShorten addresses This article shows some techniques to manipulate ...
Read More
Getting Started with argument passing
What can you learn here? Argument passing ByREF versus byVAL Optional and variable arguments     Argument passing Nowadays passing ...
Read More
Getting started with recursion
What can you learn here? Recursion coding techniques When to use recursion Dealing with tree structures Usually recursion is considered ...
Read More
Getting Started with VBA Classes
What can you learn here? Learn about classesShort code snippetsAbbreviated explanation You won't be able to fully leverage an Object ...
Read More
Looping through files in a directory
Warning Application.filesearch has disappeared in Excel 2010 Here's an alternative snippet for how to iterate through a collection of files ...
Read More
Objects and the garbage collector
When I first started playing around with VBA, everything I read emphasized how important it was that when you initialized ...
Read More
Sorting Collections
Sorting collections is something you might need to do. In this example, we'll use the cMyClass object we created in Get Started Snippets to ...
Read More
Understanding Scope
What can you learn here? Public versus Private Variable visibility External references   If you read the section on procedure arguments  you ...
Read More
Use Microsoft Speech
Converting text to speech in VBA  What can you learn here? Use microsoft SAPIAccess from any VBAOffice text to speech ...
Read More

Quick Start

Tasters of various topics on this site

Step by Step Guides
This site deals with some complex topics, and if you are trying to get started with something, it can be ...
Read More
One Liners
What can you learn here? Using ramblings librariesShort code snippetsAbbreviated explanations  Complex stuff in a few lines of code  get it ...
Read More

How to do stuff

A series of short “how tos” for things that are hard to track down

Deduce column headings from rest Query
  In Rest to Excel library there are plenty of examples of populating sheets from rest queries. Usually you simply name the ...
Read More
Mapping and Google Earth how tos
Calculate lat/lon from distance
Given a start point, a distance and a heading, it is possible to work out the resulting latitude and longitude ...
Read More
Radians Versus Degrees
A radian is the ratio of an arc's length to its radius. See the wiki diagram below Radians tend to ...
Read More
Step by Step Guides
This site deals with some complex topics, and if you are trying to get started with something, it can be ...
Read More
Urbarama mashup
This is real interesting mashup using an new Rest to Excel library entry for the urbarama API. This is a repository of interesting ...
Read More

Forms and Mice

How to position a userform on the mouse
Working with cursor position in Excel/VBA Occasionally you might need to know the mouse position, for example if you need to ...
Read More
How to traverse a treeview
Treeview traversal and recursionIn Rest Results Explorer i showed how to Create a treeview from json using the treeView control. Objects like the treeview ...
Read More
Implementation example of form at mouse position
Implement a popup form at the mouse position  get it nowNow that we know  How to position a userform on the ...
Read More

Playing around with shapes

Excel Comment shapes
What can you learn here? Interrupt commentsChange shape characteristicsAdd timestamp Modifying the behavior of Cell Comment Processing Download now This ...
Read More

Colors, Charts and formatting

VBA rgb to htmlRGB
What can you learn here? RGB VBARGB for htmlHow to convert RGB(red,green,blue) The RGB function in VBA returns the code ...
Read More
How to create a heatmap doughnut chart
A doughnut chart is sometimes used to show relative category shares, like this. Doughnut (and pie)  charts have a bad ...
Read More
Charts and color ramps
What can you learn here? ramp color scalesusing in surface chartsbrighten/darken Creating Charts with colorRampsCreate a heatmap in Excel showed how ...
Read More
Create a heatmap in Excel
  Creating heatmaps   An easy way to create heatmaps is to use conditional formatting in your spreadsheet. However, we ...
Read More
How to create a tag cloud
What can you learn here? Make a tag cloud cJobject as 'on demand' the cTagCloud class Making a tag Cloud ...
Read More
A tagCloud in Outlook
What can you learn here? Make a tag cloud in Outlook cJobject as 'on demand' Read lots of mail at ...
Read More
Color ramp library
What can you learn here? ramp color scalesgradient between colorsUse a ramp library Generalized Color RampsIf you read A tagCloud in ...
Read More

More esoteric stuff

Which VBA references you are using
VBA references Quite often you need to add some reference to be able to get some code to compile. This ...
Read More
How to prevent unwanted web caching
When you access websites through the browser, caching speeds perceived access since it only actually downloads data for pages and ...
Read More
How to add references by guid
In Which VBA references you are using we looked at how to get details about references active in a project ...
Read More
and a blog post here
Create biased random test data in VBA
Today's post is a quick function for creating biased randoms from a list of items and weights. You might need ...
Read More
Using Libraries and projects on this site
JavaScript and Google Stuff
Excel formula tweaking
A few general tips

Further reading

These snippets are introductions to concepts that are used throughout the projects in this site. You can  download everything on this site included a gettingstarted series workbook which contains all the code covered in this getting started section.