|
おはようございます
こっちの方がはやいかな。。
コードはデータ範囲を限定してるけど、
65536×256だと配列の制限にひっかかるのかな。
Sub test2()
Dim RowA As Long
Dim ColA As Long
Dim i As Long, K As Long, m As Long
Dim vntA
Application.ScreenUpdating = False
RowA = ActiveSheet.UsedRange.SpecialCells(xlCellTypeLastCell).Row
ColA = ActiveSheet.UsedRange.SpecialCells(xlCellTypeLastCell).Column
ReDim vntB(1 To RowA, 1 To ColA)
For i = 1 To RowA
vntA = Cells(i, "A").Resize(, ColA).Value
m = 1
For K = 1 To ColA
If vntA(1, K) <> "" Then
vntB(i, m) = vntA(1, K)
m = m + 1
End If
Next
Next
Range("A1").Resize(RowA, ColA).Value = vntB
Application.ScreenUpdating = True
End Sub
|
|