Hi Roy,
You can use a collection object to store the names of
functions/procedures that you can call in a loop. Another option is to
use a Class module and have a collection object inside the class module.
YOu can reference the class object (your class module at runtime) and
loop through the collection object of the class object and also
reference its properties and methods.
Save a class module as clsABC, for example. Two things that sets the
Class module apart from a standard module is that
1) you can instantiate a class module as an object
Dim ABC As New clsABC
2) you can initialize a class module using the class module Initialize
event (in the right dropdown box at the top of the module). This is
similar to a contructor in an OOP class like in VB.Net (except you don't
get inheritance since VBA is not OOP)
Of course, you can also call/reference the public members of the class
module which will show up in a dropdown list of any variable you
instantiate as that class.
Dim ABC As New clsABC
now ABC will have intellisense - if you add a period . to the end of
ABC. you will get a dropdown list of anything you declared as public in
clsABC. Class modules are a good place to store collection object.
Rich
*** Sent via Developersdex
http://www.developersdex.com ***