ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find next empty row & paste data (https://www.excelbanter.com/excel-programming/403845-find-next-empty-row-paste-data.html)

Pat Flynn

Find next empty row & paste data
 
I have a cell that I paste data in from internet directory. I am trying to
write macro that pastes & copies data-finds next empty row in col h, & paste
selection from A8:F8
The below code is not working quite right. It doesn't go to column H empty
row?
Thanks for the help.
Sub PasteLastRow()
Range("a2").PasteSpecial xlPasteAll
Range("a8:e8").Copy
Range("h1048576").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues

End Sub

Per Jessen

Find next empty row & paste data
 

"Pat Flynn" skrev i en meddelelse
...
I have a cell that I paste data in from internet directory. I am trying to
write macro that pastes & copies data-finds next empty row in col h, &
paste
selection from A8:F8
The below code is not working quite right. It doesn't go to column H
empty
row?
Thanks for the help.
Sub PasteLastRow()
Range("a2").PasteSpecial xlPasteAll
Range("a8:e8").Copy
Range("h1048576").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues

End Sub


Sub PasteLastRow()
Range("A2").PasteSpecial xlPasteAll
Range("A8:E8").Copy
Range("H65536").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues

End Sub

Regards,
Per



Pat Flynn

Find next empty row & paste data
 

Thanks Per-It turns out that my code was working-had a filtered list so I
was not seeing the results. I unfiltered the list and it works great!
Pat
"Per Jessen" wrote:


"Pat Flynn" skrev i en meddelelse
...
I have a cell that I paste data in from internet directory. I am trying to
write macro that pastes & copies data-finds next empty row in col h, &
paste
selection from A8:F8
The below code is not working quite right. It doesn't go to column H
empty
row?
Thanks for the help.
Sub PasteLastRow()
Range("a2").PasteSpecial xlPasteAll
Range("a8:e8").Copy
Range("h1048576").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues

End Sub


Sub PasteLastRow()
Range("A2").PasteSpecial xlPasteAll
Range("A8:E8").Copy
Range("H65536").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues

End Sub

Regards,
Per





All times are GMT +1. The time now is 12:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com