copy last row without header

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello again

I'm using folowing statements in my macro
the first one copy last row of filtred data and copy it to other sheet
criteria1 are changed in loop

With Sheets(wrkjm & "-9")
Set r = .Range(.Range("B1"), .Range("B" & Rows.Count).End(xlUp))
r.AutoFilter field:=2, Criteria1:=vyr
r.AutoFilter field:=4, Criteria1:=zav
Set r = r.SpecialCells(xlCellTypeLastCell).EntireRow
End With
r.Copy Sheets(wrkjm).Range("A" & radek2)

and the second one
copy filtred range without sheet's header to the other sheet
Set rng = ActiveSheet.AutoFilter.Range
If rng.Columns(1).SpecialCells(xlVisible).Count > 1 Then
rng.Offset(1, 0).Resize(rng.Rows.Count - 1).Copy _
Destination:=Worksheets(wrkjm).Range("A" & lastrow + 1)

I got both on this forum from Tom Ogilvy and work separately well

But I need to "join" them in order to achieve following:
copy last row from the filtred list without copying header to other sheet

Thanks
JH
 

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

Back
Top