Hi all,
I have 12 external files (one per month) and need a quick way to pull these into a reporting book. I've used the following code...
Workbooks.Open FileName:= _
"J:\Manfin\MIS\New Reporting\MIS2\P200301.xls"
Columns("A:B").Select
Selection.Copy
Windows("MainReportingBook.xls").Activate
Sheets("P200301").Select
Range("A1").Select
ActiveSheet.Paste
Windows("P200301.xls").Activate
Call OpenClipboard(0&): Call EmptyClipboard: Call CloseClipboard
ActiveWindow.Close
However with 10000++ rows of data in each file, this is very very slow (approx 5 mins to update all 12 months).
As a complete newbie to vb, I started by recording then amending the code - but now I need some help!
Any quick fix ideas would be greatly appreciated. I found some code on ozgrid.com to extract data without opening the file - but couldn't get it to work - my fault as I wasn't sure which bits to overwrite with my own filenames etc etc.
Thanks in advance!
Ade
I have 12 external files (one per month) and need a quick way to pull these into a reporting book. I've used the following code...
Workbooks.Open FileName:= _
"J:\Manfin\MIS\New Reporting\MIS2\P200301.xls"
Columns("A:B").Select
Selection.Copy
Windows("MainReportingBook.xls").Activate
Sheets("P200301").Select
Range("A1").Select
ActiveSheet.Paste
Windows("P200301.xls").Activate
Call OpenClipboard(0&): Call EmptyClipboard: Call CloseClipboard
ActiveWindow.Close
However with 10000++ rows of data in each file, this is very very slow (approx 5 mins to update all 12 months).
As a complete newbie to vb, I started by recording then amending the code - but now I need some help!
Any quick fix ideas would be greatly appreciated. I found some code on ozgrid.com to extract data without opening the file - but couldn't get it to work - my fault as I wasn't sure which bits to overwrite with my own filenames etc etc.
Thanks in advance!
Ade