Filter Copy/Paste Fails - Two Ranges Selected?
Hi Craig,
Set srceRng = Range("A8:z157")
srceRng.Select
srceRng.Copy
Now I need to select only the visible rows to copy and eliminate the
hard coding. This skill has been escaping me too.
Try something like:
Sub TestIt()
Dim Rng1 As Range, Rng2 As Range
Dim srceRng As Range
Dim destRng As Range
Set destRng = ActiveSheet.Range("H200") '<<=== CHANGE
Set Rng1 = ActiveSheet.AutoFilter.Range
Set Rng2 = Rng1.Offset(1).Resize(Rng1.Rows.Count - 1)
Set srceRng = Rng2.SpecialCells(xlCellTypeVisible)
srceRng.Copy Destination:=destRng
End Sub
---
Regards,
Norman
|