ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Copying information into another workbook (https://www.excelbanter.com/excel-worksheet-functions/74666-copying-information-into-another-workbook.html)

Vicky

Copying information into another workbook
 
I created a macro to take information from one worksheet and place into
another (same workbook) and put it on the next available line. However, when
I try to do it to a different workbook it doesn't work? Not sure why?

Worksheet to worksheet (works great)
Selection.Copy
Sheets("Completed Projects").Select
ActiveCell.Offset(-4, 0).Range("A1:F1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Range("A1").Select
Sheets("Current Projects").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlUp
ActiveCell.Offset(10, 0).Range("A1").Select
End Sub

Workbook to workbook (cannot get it to work)
Selection.Copy
Windows("Book3").Activate
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.End(x2Down).Select
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Range("A1").Select
Sheets("WORK ORDER.xls").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlUp
ActiveCell.Offset(10, 0).Range("A1").SelectEnd Sub

I really appreciate any assistance or suggestions.
Thanks,

--
Vicky

davesexcel

Copying information into another workbook
 

Vicky Wrote:

ActiveCell.Offset(1, 0).Range("A1").Select
Selection.End(x2Down).Select
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Range("A1").Select

I really appreciate any assistance or suggestions.
Thanks,
Vicky

Hi Vicky,
haven't tried out your macro,
but I see an error in your (xldown)
you have x2down

could it be a problem??:confused:


--
davesexcel
------------------------------------------------------------------------
davesexcel's Profile: http://www.excelforum.com/member.php...o&userid=31708
View this thread: http://www.excelforum.com/showthread...hreadid=517895



All times are GMT +1. The time now is 07:52 AM.

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