Find next empty row & paste data

P

Pat Flynn

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
 
P

Per Jessen

Pat Flynn said:
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
 
P

Pat Flynn

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
 

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

Top