Thread: Copy cell row
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Philmer Philmer is offline
external usenet poster
 
Posts: 1
Default Copy cell row


How can I modify this so that it check for all the rows that have a 40
in the last cell and will copy all the rows that have 40 in the last
cell to a new work sheet and also delete the rows after it copies them
( delete just the ones that have 40 in the last cell that it copied)


Sub CopyLastRow()
Dim LastRow As Object
Set LastRow = Sheets("Sheet2").Range("A65536").End(xlUp)

If Sheet1.Cells.SpecialCells(xlCellTypeLastCell) = 40 Then
Sheet1.Cells.SpecialCells(xlCellTypeLastCell).Enti reRow.Copy
LastRow.Offset(1, 0)
Sheet2.Cells.SpecialCells(xlCellTypeLastCell).Enti reRow.Paste
End If

End Sub


--
Philmer
------------------------------------------------------------------------
Philmer's Profile: http://www.excelforum.com/member.php...o&userid=16577
View this thread: http://www.excelforum.com/showthread...hreadid=314445