Get 15 minutes of free Live Help!

Use VBA to return a column or row from a MS Excel range address

This VBA function returns the first row, last row, first column, or last column of a Microsoft Excel range address.  It is also a good example of using a custom enumerated type.

A typical range address is a string that defines a rectangle of cells. 

read more

posted on: Jul 7, 2009 | author: Carl Connett

Find duplicates in a VBA array

This VBA function looks for duplicate values in an array.  If it finds some, it produces a list of the duplicated values.  It is a good example of how to loop through an array.

The argument needs to be an array.  Nulls in the array

read more

posted on: Jun 17, 2009 | author: Carl Connett

Use a VBA function to open/get a Microsoft Word document and Find a string

This VBA function opens/gets a MS Word document and finds the next occurrence of a specific string. The function provides a good example of using late binding automation and the AppActivate() function.

One advantage of late binding (using generic objects, like objWd in the function)

read more

posted on: Jun 12, 2009 | author: Carl Connett

Using VBA to fill and manage a Microsoft Access list box

This set of VBA functions and MS Access example show how to use code to fill a list box, clear a list box, and retrieve selected items from a list box.

The code is composed of 4 functions:

ClearListBox() – Clears a list box.  It

read more

posted on: Jun 3, 2009 | author: Carl Connett

Generate a random set of characters using VBA function Rnd()

This VBA function uses the Randomize() and Rnd() functions to generate a random string of characters with a specific length.  The included Microsoft Access example applies the function to a simple form that can be used to create a password.

When the MS Access database

read more

posted on: May 15, 2009 | author: Carl Connett

Convert a number to a date using VBA

This VBA procedure converts a number, in yyyymmdd format, to a regular date like mm/dd/yyyy.  For example, a number like 20090427 will get converted to 4/27/2009.


Public Function DateFromNumber(DateNumber)
' This function returns a date from the DateNumber value.
' For example, 20090109 returns 
read more

posted on: Apr 27, 2009 | author: Carl Connett

Next Entries »

Live Chat Software