View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Every 5 digit combination

Not sure what you mean by "nice find". I found it by writing it<g

--
Regards,
Tom Ogilvy


"JLatham" <HelpFrom @ Jlathamsite.com.(removethis) wrote in message
...
But the one you came up with is one I'll keep track of. It is determining
the permutations rather than combinations, and permutations are often
called
for also. Nice find as far as I'm concerned.

"Jim Cone" wrote:

Tom,
Thanks for that, point taken.
In fact the program removes duplicates when they do occur.
Entries with duplicate characters have the results fed thru a
collection to remove repeats. So, for instance, "food" produces
this list of 12 items not 24...
--
Regards,
Jim Cone
San Francisco, USA

food
dfoo
dofo
doof
fdoo
fodo
odfo
odof
ofdo
ofod
oodf
oofd
'--------

"Tom Ogilvy"
wrote in message
Jim, just a head up. may not fill the bill so to speak.

The numbers can repeat


Your doing straight permutations which don't allow numbers to repeat.
straight permutations: 5! = 120
permutations with numbers repeating: 5^5 = 3125
--
Regards,
Tom Ogilvy


"Jim Cone"
wrote in message
The free Excel add-in "Display Word Permutations" provided
the following list. (the list is created in a single column)
Download from ... http://www.realezsites.com/bus/primitivesoftware
No registration required.
--
Jim Cone
San Francisco, USA

13579 35179 57139 79135
13597 35197 57193 79153
13759 35719 57319 79315
13795 35791 57391 79351
13957 35917 57913 79513
13975 35971 57931 79531
15379 37159 59137 91357
15397 37195 59173 91375
15739 37519 59317 91537
15793 37591 59371 91573
15937 37915 59713 91735
15973 37951 59731 91753
17359 39157 71359 93157
17395 39175 71395 93175
17539 39517 71539 93517
17593 39571 71593 93571
17935 39715 71935 93715
17953 39751 71953 93751
19357 51379 73159 95137
19375 51397 73195 95173
19537 51739 73519 95317
19573 51793 73591 95371
19735 51937 73915 95713
19753 51973 73951 95731
31579 53179 75139 97135
31597 53197 75193 97153
31759 53719 75319 97315
31795 53791 75391 97351
31957 53917 75913 97513
31975 53971 75931 97531
'-----------------------

"seagee69"
wrote in message
As a newby to Excel VBA, I'd like to create a spreadsheet that would
give me every 5-digit combination of the numbers {1, 3, 5, 7, 9} in one
spreadsheet. The numbers can repeat.

I thought of the FOR NEXT loop, but I am not sure how to get the output
to the next row, nor am I certain it would give every combination.
Thanks so much,
seagee69