![]() |
|
#2
|
||||
|
||||
|
This is specific for 5 chosen out of 6 possibles:
Code:
Sub blah()
x = "ABCDEF"
y = Len(x)
Count = Application.WorksheetFunction.Permut(y, 5)
Set Destn = ActiveCell
ReDim Results(1 To Count, 1 To 1)
idx = 0
ReDim result(1 To 5)
For a = 1 To y
result(1) = Mid(x, a, 1)
For b = 1 To y
If b <> a Then
result(2) = Mid(x, b, 1)
For c = 1 To y
If c <> a And c <> b Then
result(3) = Mid(x, c, 1)
For d = 1 To y
If d <> a And d <> b And d <> c Then
result(4) = Mid(x, d, 1)
For e = 1 To y
If e <> a And e <> b And e <> c And e <> d Then
result(5) = Mid(x, e, 1)
idx = idx + 1
Results(idx, 1) = Join(result, "")
End If
Next e
End If
Next d
End If
Next c
End If
Next b
Next a
Destn.Resize(idx) = Results
End Sub
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need to match values in one column to values in six others and return the value of a cell from corre | SnakeDoctor | Excel | 4 | 09-09-2024 12:55 PM |
VBA to identify alpha numeric values in a word document and create a list of those values
|
olson.jacob720 | Word VBA | 0 | 04-18-2022 10:44 AM |
| Table with values from several locations and years - need to find comp values | Ricardo Sousa | Excel | 9 | 07-27-2018 02:06 AM |
Table with values from several locations and years - need to find comp values
|
Ricardo Sousa | Excel | 6 | 06-09-2018 10:51 PM |
| finding variations in the data base | adryan | Excel | 4 | 07-15-2015 12:19 AM |