Copy to next blank line

Closed
fmelvin - Jul 1, 2009 at 08:48 AM
 fmelvin - Jul 2, 2009 at 10:16 AM
I'm new to macro - so don't laugh... I'm trying to copy Cells A1 and B1 from 400 worksheets to a single worksheet (Merge). The following macro code copies and pastes the cells but overwrites each time the macro is run.

How can I tell the system to paste in the next blank row?


Sub Macro5()
'
' Macro5 Macro

'
Range("A1:B1").Select
Selection.Copy
Sheets("Merged").Select
Range("A1").Select
ActiveSheet.Paste

End Sub

2 replies

Excelguru
Posts
261
Registration date
Saturday April 11, 2009
Status
Member
Last seen
June 21, 2011
307
Jul 1, 2009 at 10:56 PM
Hi fmelvin

use Range("A401").End(xlup).Select
3
Awesome Excelguru, I'll give it a try. I'll keep you posted - thanks again.
0