how to use text boxes as an array in an EXCEL user form

M

MWJchmsn

How can a series of text boxes or labels be used as an array within a MS
EXCEL user form? (MS Office 2003/EXCEL)
 
N

Nigel

Not sure what you want to do, but if you are trying to map contents of
UserForm controls into an array then depending on how you named your
controls this may be easy or not. The same applies if you want to move the
contents of the array to the controls.

Perhaps you could be more specific in explaining what you are trying to do?
 
R

Rick Rothstein

Name your TextBoxes with the same beginning text and then affix sequential
numbers after them. For example, names something like this...

ArrayTBox1, ArrayTBox2, ..., ArrayTBox10, ArrayTBox11, etc

Here is simple code to showing you how to use the Controls collection to
address them...

For X = 1 To 12
Controls("ArrayTBox" & X).Value = "TBox Number: " & X
Next

Obviously, the TextBoxes will not be in a "true" array, but you will be able
to address them as if they were.
 

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