View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
BrianB BrianB is offline
external usenet poster
 
Posts: 1
Default Array Combinations with a Twist

Only with code AFAIK. Here is the 4 word set :-


Code
-------------------

'=============================================
Option Base 1
'-----------------------------------------------
Sub test()
Dim MyArray As Variant
Dim Mystring As String
MyArray = Array("The", "quick", "brown", "fox")
Dim ToRow As Long
'-------------------------------------
ToRow = 1
For c1 = 1 To 4
For c2 = 1 To 4
For c3 = 1 To 4
For c4 = 1 To 4
'-----------------------------------------------------------------
If Not (c1 = c2 Or c1 = c3 Or c1 = c4 _
Or c2 = c3 Or c2 = c4 _
Or c3 = c4) Then
Mystring = MyArray(c1) & MyArray(c2) & MyArray(c3) & MyArray(c4)
ActiveSheet.Cells(ToRow, 1).Value = Mystring
ToRow = ToRow + 1
End If
'-------------------------------------------------------------
Next
Next
Next
Next
End Sub
'==============================================

-------------------


--
Message posted from http://www.ExcelForum.com