
Looping Through TextBoxes - If it is Possible - How?
Corrected Error
Quote:
>-----Original Message-----
>Hi,
>I collected all my data, now I want to put it into arrays
to do computations
>then put it in a document.
>I can find the bookmark and put the value/text of array
variables after the
>bookmark using concatenation as follows:
BookMarkCount = 1
Do until BookMarkCount = 10
BookMarkName = "MyBookMark" & BookMarkCount
'This becomes MyBookMark1, MyBookMark2, etc.
ActiveDocument.Bookmarks(BookMarkName).Range.InsertAfter
ArrayName(BookMarkCount-1, 0)
'Subtract one from BookMarkCOunt To get the corresponding
Array Element Since Arrays start at zero
' Which you could change to start at one but I didn't
BookMarkCount = BookMarkCount + 1
Loop
Quote:
>I want to do a similar thing to put the string/value of
the textbox into an
>array using concatenation.
TextBoxCount = 1
Do until TextBoxCount = 10
TextBoxPosition = "ArrayName" $ TextBoxCount
MyArray(TextBoxCount - 1, 0) =
UserForm1.TextBoxPosition .Value
'Remembering first position of array is 0
' I would hope TextBoxPosition would evaluate to TextBox1;
TextBox2 etc -
But Not - Just an empty string no error
TextBoxCount = TextBoxCount + 1
Loop
Quote:
>How can I (if possible) do the above.
>Thanks,
>Ghost