Sub
myCopy()
Dim
lngRow
As
Long
, lngCol
As
Long
, Rng
As
Range, Adr
As
String
lngRow = 1: lngCol = 1
With
Sheets(1)
On
Error
Resume
Next
If
.AutoFilterMode
Then
.Cells.AutoFilter
lngRow = .Cells.Find(
"*"
, .Cells(1), -4123, 2, 1, 2,
False
).Row
lngCol = .Cells.Find(
"*"
, .Cells(1), -4123, 2, 2, 2,
False
).Column
On
Error
GoTo
0
Set
Rng = .Range(.Cells(1), .Cells(lngRow, lngCol))
Adr = Rng.Address(0, 0)
Rng.copy Sheets(2).Cells(1)
End
With
With
Sheets(2)
Set
Rng = .Range(Adr)
.Range(Adr).Sort _
Key1:=Rng.Columns(4), Order1:=xlAscending, _
Header:=xlYes, orderCustom:=1, _
MatchCase:=
False
, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End
With
End
Sub