View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Howard Howard is offline
external usenet poster
 
Posts: 536
Default For Eachcell in Range tranpose comma seperated values to a list in D


This works great for cell A1 to rows in D.
How do I modify the code to do A1:Ax into column D down as far as needed?

My "Error 400" code attempt at it follows this working code.

Thanks.
Howard

Option Explicit

Sub SuperSplit()
Dim vArray As Variant
Dim x As Long
vArray = Split(Application.Transpose(Range("A1")), ", ") '" / ")
For x = 0 To UBound(vArray)
Range("D1").Offset(x, 0).Value = vArray(x)
Next
End Sub


Not working:

Sub SuperSplitX()

Dim vArray As Variant
Dim x As Long
Dim c As Range
Dim y As Long
y = 1
For Each c In Range("A1:A3")
vArray = Split(Application.Transpose(Range("A:" & y)), ", ") '" / ")
y = y + 1
For x = 0 To UBound(vArray)
Range("D1").End(xlUp).Offset(x, 0).Value = vArray(x)
Next
Next

End Sub