J
Joyce
Hi,
I'm trying to copy and paste filtered data on Wksht A into a report on Wksht
B. The number of lines in the filtered range on Wksht A will vary for each
report.
The upper left paste location on Wkst B is a cell named SpecDate.
I want to insert extra complete rows if the filtered data is greater than 1
row. This is because I have other report sections below the destination that
I wish to push down.
I've tried a few ways, but to no avail. This is my latest attempt - I don't
get errors but nothing pastes. I'm *not* great in VBA, as you can see.
Thanks!
Dim rng As Range, i As Long
Set rng = ActiveCell.CurrentRegion
rng.Select
i = rng.Rows.Count
rng.Copy
Application.Goto Reference:="SpecDate"
If i = 1 Then
rng.PasteSpecial Paste:=xlPasteAll
Else
ActiveCell.EntireRow.Resize(rowsize:=i - 1).Insert Shift:=xlDown
rng.PasteSpecial Paste:=xlPasteAll
End If
I'm trying to copy and paste filtered data on Wksht A into a report on Wksht
B. The number of lines in the filtered range on Wksht A will vary for each
report.
The upper left paste location on Wkst B is a cell named SpecDate.
I want to insert extra complete rows if the filtered data is greater than 1
row. This is because I have other report sections below the destination that
I wish to push down.
I've tried a few ways, but to no avail. This is my latest attempt - I don't
get errors but nothing pastes. I'm *not* great in VBA, as you can see.
Thanks!
Dim rng As Range, i As Long
Set rng = ActiveCell.CurrentRegion
rng.Select
i = rng.Rows.Count
rng.Copy
Application.Goto Reference:="SpecDate"
If i = 1 Then
rng.PasteSpecial Paste:=xlPasteAll
Else
ActiveCell.EntireRow.Resize(rowsize:=i - 1).Insert Shift:=xlDown
rng.PasteSpecial Paste:=xlPasteAll
End If