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 ...
Clean up Pivot Cache
What can you learn here? Space used by pivot cache Match cache to pivots Clear out cache errors Using Pivot ...
Formatting range addresses
What can you learn here? Easy format for debugging Remove dollars for fill Shorten addresses This article shows some techniques ...
Getting Started with argument passing
What can you learn here? Argument passing ByREF versus byVAL Optional and variable arguments   Argument passing Nowadays passing arguments ...
Getting started with recursion
What can you learn here? Recursion coding techniques When to use recursion Dealing with tree structures Usually recursion is considered ...
Getting Started with VBA Classes
What can you learn here? Learn about classes Short code snippets Abbreviated explanation You won't be able to fully leverage ...
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 ...
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 ...
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 ...
Understanding Scope
What can you learn here? Public versus Private Variable visibility External references Understanding Scopes If you read the section on procedure ...
Use Microsoft Speech
Converting text to speech in VBA  What can you learn here? Use microsoft SAPIAccess from any VBAOffice text to speech ...

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 ...
One Liners
What can you learn here? Using ramblings libraries Short code snippets Abbreviated explanations Complex stuff in a few lines of ...

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 columns ...
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 ...
Radians Versus Degrees
A radian is the ratio of an arc's length to its radius. See the wiki diagram below Radians tend to ...
Step by Step Guides
This site deals with some complex topics, and if you are trying to get started with something, it can be ...
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 ...

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 ...
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 ...
Implementation example of form at mouse position
Implement a popup form at the mouse position  get it now Now that we know  How to position a userform on ...

Playing around with shapes

Excel Comment shapes
What can you learn here? Interrupt comments Change shape characteristics Add timestamp Modifying the behavior of Cell Comment Processing Download ...

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 ...
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 ...
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 ...
Create a heatmap in Excel
Creating heatmaps   An easy way to create heatmaps is to use conditional formatting in your spreadsheet. However, we are ...
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 ...
A tagCloud in Outlook
What can you learn here? Make a tag cloud in Outlook cJobject as 'on demand' Read lots of mail at ...
Color ramp library
What can you learn here? ramp color scalesgradient between colorsUse a ramp library Generalized Color RampsIf you read A tagCloud in ...

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 ...
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 ...
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. Let's look ...
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 ...
Using Libraries and projects on this site How to use cDataset

How to use cDataset

Clear data cells with cDataSet

Make a copy of a worksheet

Make a filtered copy of a worksheet

Make a copy of some of the columns in a worksheet

Make a copy of a sheet and respect autofilter

How to identify and modify rows hidden by autofilter

Coloring maps and other shapes

How to make a table from a cdataset

How to use CJobject

Passing complex arguments in VBA – copy how its done in javaScript

use cJobject to create a unique list

Web Services

How to use the Excel Roadmapper

Execute SQL from Excel

Consolidating Sheets in an Excel Workbook

How to do Basic HTTP Authentication from VBA

Creating an index sheet for a workbook

How to update modules automatically in VBA

JavaScript and Google Stuff

javaScript ‘howTo’

From VBA to Google Apps Script

How to simulate for each loop in javaScript

How to use javaScript from VBA

How to pass arrays between javaScript and VBA

How to sort a VBA array using javaScript

How to pass arguments to VBA using jSON – just like javaScript

d3.js

Using scriptDB

Tracking activity with ScriptDB

Using Google Apps Script Content Service as wrapper for multiple APIS

GAS hacks for VBA

How to manage and share libraries in Google Apps Script

Excel formula tweaking

Leveraging sorted data with Match

Regular Expressions

Named Ranges

Named Ranges with Column Headings

SumProduct

Search

3d Validation

Using match to categorize

Respect a Filter with Sumproduct

The birthday problem

A few general tips

What to do if you get the “Object Library Invalid Error Message”

How to embed gist code samples in Blogger

How to embed gist samples in Google Sites

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.