How to import excel information

Log

Board Regular
Joined
Nov 4, 2011
Messages
51
1. The first file folder is named Work
2. Within the first file folder are file folders titled Employee 1, Employee 2, and Employee Summary.
3. Within Employee 1 and Employee 2 are workbooks titled Day 1 and Day 2 with information on Sheet 1 starting in A1 and Ending in D7.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p>
I would like a VBA code that will import information from the file folders Employee 1 and Employee 2, Workbooks Day 1 Day 2 into a Employee Summary Workbook starting in cell A1. Can someone provide a VBA code that will pull information into the Employee summary workbook? If this does not make sense please tell me so I can try to explain better. Thank You<o:p></o:p>
</o:p>
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
1. The first file folder is named Work
2. Within the first file folder are file folders titled Employee 1, Employee 2, and Employee Summary.
3. Within Employee 1 and Employee 2 are workbooks titled Day 1 and Day 2 with information on Sheet 1 starting in A1 and Ending in D7.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p>
I would like a VBA code that will import information from the file folders Employee 1 and Employee 2, Workbooks Day 1 Day 2 into a Employee Summary Workbook starting in cell A1. Can someone provide a VBA code that will pull information into the Employee summary workbook? If this does not make sense please tell me so I can try to explain better. Thank You<o:p></o:p>
</o:p>

If I understand, maybe this will do it? Change the paths to yours.

Code:
Sub log()

Workbooks.Open Filename:="D:\Common\data\Work\Employee Summary.xls"
Workbooks.Open Filename:="D:\Common\data\Work\Employee1\Day2.xls"
Workbooks.Open Filename:="D:\Common\data\Work\Employee1\Day1.xls"

Workbooks("Day1.xls").Sheets("Sheet1").Range("A1:D7").Copy Workbooks("Employee Summary.xls").Sheets("Sheet1").Range("A" & Rows.Count).End(3)(2)
Workbooks("Day1.xls").Close
Workbooks("Day2.xls").Sheets("Sheet1").Range("A1:D7").Copy Workbooks("Employee Summary.xls").Sheets("Sheet1").Range("A" & Rows.Count).End(3)(2)
Workbooks("Day2.xls").Close

Workbooks.Open Filename:="D:\Common\data\Work\Employee2\Day2.xls"
Workbooks.Open Filename:="D:\Common\data\Work\Employee2\Day1.xls"

Workbooks("Day1.xls").Sheets("Sheet1").Range("A1:D7").Copy Workbooks("Employee Summary.xls").Sheets("Sheet1").Range("A" & Rows.Count).End(3)(2)
Workbooks("Day1.xls").Close
Workbooks("Day2.xls").Sheets("Sheet1").Range("A1:D7").Copy Workbooks("Employee Summary.xls").Sheets("Sheet1").Range("A" & Rows.Count).End(3)(2)
Workbooks("Day2.xls").Close

End Sub
 
Upvote 0
Workbooks.Open Filename:="D:\Common\data\Work\Employee Summary.xls"


This is the first line of it. What does that mean?
 
Upvote 0

Forum statistics

Threads
1,213,550
Messages
6,114,265
Members
448,558
Latest member
aivin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top