|
いろいろなロジックが考えられますが、私も一例を提示してみます。
Sub Test_Split_Data()
Dim i As Long, Cnt As Long, MyCnt As Long
Dim C As Range
Application.ScreenUpdating = False
With Range("A1", Range("A65536").End(xlUp))
Cnt = WorksheetFunction.CountIf(.Cells, "TEXT")
.Cells(1).Resize(, Cnt).Value = "TEXT"
With .Offset(, 255)
.Formula = "=IF($A1=""TEXT"","""",$A1)"
.Value = .Value
For Each C In .SpecialCells(2).Areas
i = i + 1: If i = 1 Then MyCnt = C.Count + 1
Cells(2, i).Resize(C.Count).Value = C.Value
Next
.ClearContents
End With
End With
Range(Range("A1").Offset(MyCnt), Range("A65536").End(xlUp)) _
.ClearContents
Application.ScreenUpdating = True
End Sub
|
|