PDA

View Full Version : Solved: Copy and past in next available row



Klartigue
09-14-2011, 12:23 PM
Sub CopyandPaste()

Dim LastRow As Long

With ActiveSheet

Range("A2:G2").Resize(Range("A2").End(xlDown).Row - 1).Select
Selection.Copy
Windows("Broker Volume Master.xlsx").Activate
Application.Run "BLPLinkReset"
Range("A2").Resize(Range("A2").End(xlDown).Row + 1).Select
ActiveSheet.Paste
End With

End Sub

On the attached sheet, how do i get this block of data to paste into the sheet, starting in the next available row A10? FYI, the next available row will change since i will be inputting more data on this sheet overtime so i need a general reference to the row after the last occupied row.

Thank you!

Bob Phillips
09-14-2011, 02:59 PM
Sub CopyandPaste()
Dim LastRow As Long

With ActiveSheet

.Range("A2:G2").Resize(.Range("A2").End(xlDown).Row - 1).Copy
End With

Windows("Broker Volume Master.xlsx").Activate
Application.Run "BLPLinkReset"
With ActiveSheet

LastRow = .Range("A2").End(xlDown).Row
.Cells("A", LastRow + 1).Paste
End With
End Sub

Klartigue
09-16-2011, 09:43 AM
Apparently there is a problem with .Cells("A",LastRow +1).Paste but I am not sure what is wrong?

Thanks for the help!

GTO
09-16-2011, 02:32 PM
This sounds to be the same issue being dealt w/at http://vbaexpress.com/forum/showthread.php?t=39073 No?