View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Paste selection minus the first row....

You'll have to change the range that should be copied. Just avoid that topmost
row.


With RngToCopy
set rngtocopy = .resize(.rows.count-1).offset(1,0)
end with

This may even work???



RompStar wrote:

Hi there,

I have code that copies from a sheet to a new sheet in a different
workbook. It's doing appends onto the same sheet. For the first
paste I want to paste everything, but for the second paste, I want to
paste everything minus the first row, which is a header row. In the
Else how do I tell VBA to ActiveSheet.Paste (-1) ????

This If-Then-Else

If lastrow2 = 1 Then
ActiveSheet.Paste
Else
real = lastrow2 + 1
Range("A" & real).Select
ActiveSheet.Paste
End If

Thanks for the help.


--

Dave Peterson