#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default LOOP HELP!

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default LOOP HELP!

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
--
Best regards,
Edward


"DarrenL" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
returning back to loop check condition without completing the loop ashish128 Excel Programming 13 April 3rd 08 12:53 PM
Loop to Filter, Name Sheets. If Blank, Exit Loop ryguy7272 Excel Programming 3 February 5th 08 03:41 PM
Naming Worksheets - Loop within a loop issue klysell Excel Programming 0 March 27th 07 11:17 PM
(Complex) Loop within loop to create worksheets klysell Excel Programming 1 March 20th 07 12:03 AM
Advancing outer Loop Based on criteria of inner loop ExcelMonkey Excel Programming 1 August 15th 05 05:23 PM


All times are GMT +1. The time now is 10:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"