Code to paste info from one workbook to another

Hi,

I have a line of code that works in terms of pasting, but it's pasting in the activeworkbook. I'm trying to paste it into a workbook called "Sample Facility Systems" but when i add that on, it doesn't seem to work.

line of code that works, but pastes in wrong workbook:

[code]
Workbooks("Database.xls").Sheets(e) _
.Cells(Counter, i + 1).Copy Destination:=Cells(200, e).End(xlUp).Offset(1, 0)

[/code]


line of code that doesn't work but specifies the workbook:

[code]
Workbooks("Database.xls").Sheets(e) _
.Cells(Counter, i + 1).Copy Destination:=Workbooks("Sample Facility Systems").Sheets(1).Cells(200, e).End(xlUp).Offset(1, 0)

[/code]

thanks for any help!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories