View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] trigo1@cox.net is offline
external usenet poster
 
Posts: 4
Default All possible Alpha character combonations

WOW THAT EXAXTLY WHAT I NEEDED! Thank you so much! I thought i would
be able to munipulate the script to adjust it to diffrent cell ranges
in the sheet but i havent figured that out yet(vba rookie). Also how
could i change it to be flexible and compare anyehere from 1 to 10
items in each set, becasue the data inputed will vary from 1 to 10
items?? Thank you so much for your help!!!!!!!!


Tom Ogilvy wrote:
Assume the two sets are in A1:A4 and B1:B4

Sub ABD()
Dim rw As Long, i As Long, j As Long
rw = 0
For i = 1 To 4
For j = i + 1 To 4
If StrComp(Cells(i, 1), Cells(j, 1), _
vbTextCompare) < 0 Then
rw = rw + 1
Cells(rw, "C") = Cells(i, 1) & ", " & Cells(j, 2)
End If
Next
Next

End Sub

--
Regards,
Tom Ogilvy



wrote in message
oups.com...

For now I think both sets are always the same, thus the same length ,
and order of pairs doesn't matter.



Tim Williams wrote:
Both sets are always the same?
Sets are of the same length or can they be different lengths?
Order of pairs doesn't matter ?

Perhaps you can define your requirements (or the context) a bit more
explicitly.

Tim


wrote in message
oups.com...
I am trying to render all the possible combonations of two sets of alpa
data.

For example

Price
MGP
Comfort
Style

would be compared to

Price
MGP
Comfort
Style

and thus there are 6 possible combonations

price, MGP
price, comfort
price, style
MGP,comfort
MGP, style
comfort,style


How could i do this in excel????