Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
Permutations andText to column problem
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="GS, post: 7416896"] I revised your code to only execute TxToCol once after all permutations have been made. The way you had it working, it was overwriting all existing data in D:F for each permutation... Option Explicit Option Compare Text Dim lCurRow& Sub DoString() lCurRow = 1: Call GetPermutation("", Cells(1, 1)) Call TxToCoL End Sub Sub GetPermutation(X As String, y As String) Dim j&, i& j = Len(y) If j < 2 Then Cells(lCurRow, 1) = X & y: lCurRow = lCurRow + 1 Else For i = 1 To j GetPermutation _ X + Mid(y, i, 1), Left(y, i - 1) + Right(y, j - i)) Next 'j End If 'j < 2 End Sub Sub TxToCoL() Range(Cells(1, 1), Cells(1, 1).End(xlDown)).TextToColumns _ Destination:=Range("D1"), DataType:=xlFixedWidth, _ FieldInfo:=Array(Array(1, 1), Array(2, 1), Array(3, 1), _ Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), _ Array(8, 1), Array(9, 1)), _ TrailingMinusNumbers:=True End Sub -- Garry Free usenet access at [URL]http://www.eternal-september.org[/URL] Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
Permutations andText to column problem
Top