LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Generating multiple variable permutations

Tom-
I am familiar with the piece of code that you directed me to, however,
this will not do what I described in my original post. While this is
an impressive piece of code for generating simple permuations, the
situation I am looking at is much more complex.


Tom Ogilvy wrote:
http://www.j-walk.com/ss/excel/tips/tip46.htm

use this as a "generator" to make your permutations.

--
Regards,
Tom Ogilvy


wrote in message
ups.com...
Now here's a tricky one!!!...
I'm trying to write some VBA code to generate a sequence of
combinations of numbers and letters. A single letter will always be
combined with a single number, but a letter will never be combined with
another letter or a number will never be combined with another number
(i.e.- combining unlike variable types in pairs, for example: 1A, 2A,
1B, 2B). Numbers always preceed letters in each pair. Also, the
unlike pair combinations should be grouped for all possible unlike pair
combinations (total possible unlike pair
combinations=QtyVarTypeLetter*QtyVarTypeNumber). For example, if
variable type Letter has two possibilities (A and B), and variable type
Number also has two possibilities (1 and 2), then there would be 4 pair
combinations in each group (e.g.- 1A, 2A, 1B, 2B).

Additionally, like number pairs should be kept together (i.e.- not
alternated) in each group. Now my question becomes, how do I generate
all the possible permutations of the above described groups? In the
example I've been describing there would be y permutations (I'm pretty
sure that y=Letters!^Numbers*Numbers!=2^2*2=8). The permutations would
be the following:

1A1B 2A2B
1B1A 2A2B
1A1B 2B2A
1B1A 2B2A
2A2B 1A1B
2B2A 1A1B
2A2B 1B1A
2B2A 1B1A

Conceptually speaking, one thing to liken this to is rings on cones.
If you have 2 blue rings and 2 red rings and two movable cones (1 and
2). Then what are all the possible combinations of rings on cones,
with only ring color order and cone order being important, and needing
to have exactly 2 different color rings on each cone (one ring must be
red and one ring must be blue on each cone)?

Thanks for your help on this!!! I know it isn't an easy one!!!


 
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
Generating Pivot Table from multiple worksheet jackysoh Excel Worksheet Functions 1 October 4th 07 06:41 PM
Generating parts list from multiple sheets Prescher New Users to Excel 1 April 7th 07 12:14 AM
Generating Footers for Multiple sheets in Workbook Ron Excel Programming 2 March 9th 06 04:30 PM
why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel? Daniel Excel Worksheet Functions 1 July 9th 05 03:05 AM
Generating multiple sheets within a workbook all titled with a ca. Matt Excel Programming 1 February 18th 05 09:55 PM


All times are GMT +1. The time now is 08:14 AM.

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

About Us

"It's about Microsoft Excel"