View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
JH JH is offline
external usenet poster
 
Posts: 64
Default copy last row without header

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