Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Looping through valid inputs (VBA)

How to write a simple program to:


Test all possible combinations of adding two numbers that range from
1-100 each (10,000 total possible combination) using some sort of
looping structure.



My guess (and I'm new at programming) is that there will be some sort
of nested loops but the logic escapes me.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Looping through valid inputs (VBA)

Not sure what you want to test but

for N = 1 to 100
for M = 1 to 100
'perform test
next
next

will give you the loop structure you want.

wrote:
How to write a simple program to:


Test all possible combinations of adding two numbers that range from
1-100 each (10,000 total possible combination) using some sort of
looping structure.



My guess (and I'm new at programming) is that there will be some sort
of nested loops but the logic escapes me.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,203
Default Looping through valid inputs (VBA)

DS's solution is for those who don't trust the system.
Bob Phillips is for those with faith in something as well established as For
Next loops to actually work.

You could combine the two in your MsgBox output to compare the values
computed by each method.

"DesireeStar" wrote:

Heh, yeah. I mean to produce an actual number as to how many times it
looped total.

Ie:
MsgBox "This looped " + loopCountTotal + " times"


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
Quarterly inputs Loadmaster Excel Worksheet Functions 2 August 28th 09 03:22 PM
custom inputs Tom Excel Discussion (Misc queries) 1 September 2nd 08 10:39 PM
A question of two inputs Finance Guru Excel Worksheet Functions 0 March 27th 08 01:58 PM
Inputs. Steven. Excel Programming 4 August 18th 04 01:12 PM
Help with Date Inputs Mark[_38_] Excel Programming 0 March 4th 04 01:58 PM


All times are GMT +1. The time now is 05:22 PM.

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"