|
こんばんは。
もっと速いのはあるとおもいますけど
思い浮かばないので、たたき台で
Sub test()
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
For i = 1 To RowA
vntA = Cells(i, "A").Resize(, ColA).Value
ReDim vntB(1 To 1, 1 To ColA)
m = 1
For K = 1 To ColA
If vntA(1, K) <> "" Then
vntB(1, m) = vntA(1, K)
m = m + 1
End If
Next
Cells(i, "A").Resize(, ColA).Value = vntB
Next
Application.ScreenUpdating = True
End Sub
|
|