Dynamically Generated Variable Names

D

Donald Nova

I guess this is a bit of a newbie question...but if there a way to
dynamically generate variable names. i.e like the following psuedo-code:

==================
Dim i As Integer
For i = 1 To 10
Dim ("myNum" & i) As String
("myNum" & i) = "My number is " & i
Next i
==================

I'm using VBA (Word 2000), and want to generate a number of user-defined
TYPE variables, each with a unique name (the point of this posting), that
are then stored in an array, which can then be referenced by that name at a
later time.

Any help would be greatfully appreciated!

Cheers
Donald
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top