|
Sub Temp()
Dim arr1, arr2, intRowW As Integer, intRowL, intRowA As Integer
With Sheet1
intRowA = 1
Do While intRowA < .Range("A65536").End(xlUp).Row
If .Range("A" & intRowA) <> "" Then
If .Range("A" & intRowA + 1) <> "" Then
intRowL = .Range("A" & intRowA).End(xlDown).Row
ReDim arr1(1 To intRowL - intRowA + 1), arr2(1 To intRowL - intRowA + 1, 1 To 1)
arr1 = .Range("A" & intRowA & ":A" & intRowL)
For intRowW = LBound(arr1) To UBound(arr1)
arr2(intRowW, 1) = WorksheetFunction.Small(arr1, intRowW)
Next intRowW
.Range("A" & intRowA).Resize(UBound(arr1)) = arr2
intRowA = intRowL + 1
Else
intRowA = intRowA + 1
End If
Else
intRowA = intRowA + 1
End If
Loop
End With
End Sub
|
|