-
Solved: import data from another workbook
Hello all. I am trying to import data without using microsofts wizards because I have so many imports that I need to do that it is starting to strip some of my data out.
I need help writing some code to preserve the integrity and formats of a particular sheet of a particular workbook, and pasting it into cell A1 of the workbook I need the data to appear in.
Lets say I have Workbook1.xls open and need data from another file to be imported onto the sheet "Master" of Workbook1.xls. The data I need pasted is all contents from Workbook2.xls and the sheet is called Sheet1. I would like to just be able to paste this data into the code that runs when the file is opened.
Help would be appreciated. Thanks!
-
Oh yeah i forgot to add that that Workbook1.xls is stored in C:\Test\Data and Workbook2.xls is stored in C:\Test\Now
-
Is the Source workbook already open when the code is run?
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
-
No the source workbook would be closed when the code is ran.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules