View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Permutations andText to column problem

Oops.., I missed renaming a variable...

Sub GetPermutation(sBlank$, sTextIn$)
Dim lTxtLen&, i&
lTxtLen = Len(sTextIn)
If lTxtLen < 2 Then

Cells(lCurRow, 1) = sBlank & sTextIn: lCurRow = lCurRow + 1
Else
For i = 1 To lTxtLen
GetPermutation sBlank + Mid(sTextIn, i, 1), _
Left(sTextIn, i - 1) + Right(sTextIn, lTxtLen - i)
Next
End If
End Sub


--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion