ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Pull values from each .xls file in dir (https://www.excelbanter.com/excel-discussion-misc-queries/90955-pull-values-each-xls-file-dir.html)

Duke17

Pull values from each .xls file in dir
 

I have a directory of X amount of .xls files. They are all in the same
format, just different numbers. I would simply like to use a bit of
code to scan through every file and copy 2 different cells into one
line of a .txt file. The results would be like:

139 $1,000.00
244 $3,235.54
456 $ 896.66

Jim Cone

Pull values from each .xls file in dir
 
Ron de Bruin has various ways to do that at ...
http://www.rondebruin.nl/ado.htm
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Duke17" wrote in message
I have a directory of X amount of .xls files.
They are all in the same format, just different numbers.
I would simply like to use a bit of code to scan through
every file and copy 2 different cells into one line of a .txt file.
The results would be like:

139 $1,000.00
244 $3,235.54
456 $ 896.66

Duke17

Pull values from each .xls file in dir
 

Jim, thanks for directing me to that link, it's been very helpful.
There's one thing I'm having trouble with, though. I need to "set a
reference to the Microsoft ActiveX Data Objects 2.5 library in the VBA
editor." I'm not sure how to do this...can you please help?

Thanks!


--
Duke17
------------------------------------------------------------------------
Duke17's Profile: http://www.excelforum.com/member.php...fo&userid=8361
View this thread: http://www.excelforum.com/showthread...hreadid=546205


Jim Cone

Pull values from each .xls file in dir
 
In the VBE , (that's the place that you write your code), go to the
menu bar and select: Tools | References.
In the drop down list, find and checkmark the library name.
I have several versions of the ...Data Objects library listed.
It's probably best to checkmark the latest version.
--
Jim Cone
San Francisco, USA
http://www.officeletter.com/blink/specialsort.html


"Duke17" wrote in message
Jim, thanks for directing me to that link, it's been very helpful.
There's one thing I'm having trouble with, though. I need to "set a
reference to the Microsoft ActiveX Data Objects 2.5 library in the VBA
editor." I'm not sure how to do this...can you please help?
Thanks!
--
Duke17


Duke17

Pull values from each .xls file in dir
 

Thanks for your help, I included the reference like you suggested and it
works just fine now.

Take care,
Brian


--
Duke17
------------------------------------------------------------------------
Duke17's Profile: http://www.excelforum.com/member.php...fo&userid=8361
View this thread: http://www.excelforum.com/showthread...hreadid=546205



All times are GMT +1. The time now is 08:50 PM.

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