LOOP HELP!

D

DarrenL

I am trying to create a loop in which it will ask the same questions to the
user repeatedly until the user opts out. However, I need to be able to
reference the answers to all of their questions each time they go through the
loop. How do assign a variable when they will change each time and be
differrent for each question they are asked? example: color type size
continue? color type size continue? loop---------and have all of those
answers accessible. Not just the last one. Thanks
D
 
E

Edward

You can use an array variable and if the size is variable you can use the
combination of Redim Preserve
something like

Sub readInput()
Dim i As Long
Dim myarray()

Do While <---- some boolean to check
ReDim Preserve myarray(i)
myarray(i) = MsgBox("your question", vbYesNoCancel)
i = i + 1
Loop


End Sub
 

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