• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

From one workbook to another (Excel 2003)

Excelnoub

Member
I need help in tranferring information in an existing code from one workbook to another. Is this possible?


Here is my code but I need to change it in order to transfer the information on another Workbook.


If LCase(Target.Value) = "cancelled" Then

Range(Cells(Target.Row, 1), Cells(Target.Row, 9)).Copy

Sheets("Archives").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues

Application.EnableEvents = False

Range(Cells(Target.Row, 1), Cells(Target.Row, 13)).ClearContents

Application.EnableEvents = True

End If


Sheets("Archives").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues


The "Archives" should be changed to the following: Archives.xls


I have another workbook names: Archives.xls that I need the code to run if it cancels then to transfer the information in this workbook. Path of documents location is my Desktop.
 
Hi, Excelnoub!


Assuming you have both files opened at same tiem, try changing this:

Sheets("Archives").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues

by this:

Workbooks("Archives.xls").Sheets("Archives").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues

changing "Archives" sheet in Archives.xls for proper sheet name.


Regards!
 
Back
Top