Copying filtered cells from a specific location

K

kativa

I have a filtered sheet, and I want to copy all visible cells to another
sheet starting from cell B4 (header cell) to column E. All headers from B to
E included, and the amount of visible rows varies. From the same sheet I also
need to copy the first visible cell from column A - header not included. Area
B4 to Esomething is copied to a different location on the other sheet than
the first filtered cell from column A.

I need more brain capacity!!! :=)
 
M

Michael

Try this changing cell and Sheet References as needed.

Sub Test()
Dim CopyRng As Range
Dim DestCell As Range
Set DestCell = Worksheets("Sheet2").Range("A1")
iLastRow = Range("B65536").End(xlUp).Row

Set CopyRng = Range("B4:E" & iLastRow).SpecialCells(xlCellTypeVisible)
CopyRng.Copy
DestCell.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top