範囲が例の範囲だと考えて2箇所分です。
Exampleを実行して下さい。
Sub Example()
Call mSet(Range("B4:E14"))
Call mSet(Range("B16:E26"))
End Sub
Function mSet(mRange As Range)
Dim mData As Variant, mData2 As Variant
Dim mRow As Long, mColumn As Long
Dim c As Long, r As Long, r2 As Long
mData = mRange
ReDim mData2(1 To UBound(mData), 1 To UBound(mData, 2))
For c = 1 To UBound(mData, 2)
r2 = 1
For r = 1 To UBound(mData)
If mData(r, c) <> "" Then
mData2(r2, c) = mData(r, c)
r2 = r2 + 1
End If
Next
Next
mRange = mData2
End Function
お礼
ありがとうございます。大変勉強になり助かりました。