Transpose code has ceased to transpose
Howard,
I became a bit confused when trying to follow what the macro is intended to do. It sounds like you want it to take a single string from cell B1 and split it out to its component pieces in column A. The macro you posted, however, does the opposite. It takes the data in column A and concatenates it with a delimiter in cell B1. Thus, with no data in column A, the result of the macro will be a string of commas.
After trying out the macro you provided, I reworked it to do the opposite (take a value in cell B1 and transpose it to column A). Both versions are copied below. Hopefully one of them will work for your needs.
Option Explicit
Sub SuperSplit()
'copies elements in cell B1 into column A
Dim vArray As Variant
Dim x As Long
vArray = Split(Application.Transpose(Range("B1")), ", ") '" / ")
For x = 0 To UBound(vArray)
Range("A1").Offset(x, 0).Value = vArray(x)
Next
End Sub
Sub SuperJoin()
'Joins column A elements into a single string in cell B1
Range("B1") = Join(Application.Transpose(Range(Range("A1"), _
Range("A" & Rows.Count).End(xlUp))), ", ") '" / ")
End Sub
|