Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default retrieve cell value from the cosed file

I have a example here also
http://www.rondebruin.nl/summary2.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Greg Wilson" wrote in message ...
This doesn't require you to open the workbooks. Since you have 400, I would
think the workbook open/copy/close approach will be rather klunky. I just
wrote this for you just now and havn't had occasion to use it so can't
confirm its reliability. Suggest you give it a shot.

Regards,
Greg

Sub GetValsByFormula()
Dim FNs As Variant
Dim FN As String, Pth As String
Dim i As Integer

On Error GoTo ExitProc
FNs = Application.GetOpenFilename _
("Excel Files(*.xl?), *.xl?", MultiSelect:=True)
If TypeName(FNs) = "Boolean" Then Exit Sub
FN = Dir(FNs(LBound(FNs)))
Pth = Left(FNs(LBound(FNs)), Len(FNs(LBound(FNs))) - Len(FN))
For i = LBound(FNs) To UBound(FNs)
FN = Dir(FNs(i))
Cells(i, 1).Formula = "= '" & Pth & "[" & FN & "]Sheet1'!A1"
Cells(i, 2).Formula = "= '" & Pth & "[" & FN & "]Sheet1'!B1"
Next
ExitProc:
End Sub

"igorek" wrote:

Hello,

I have 400 files in the direcrory of the identical format. in order to
create a proper check tool i need my code to go into every single file pick
up values in cells A1 and B1 and populate these values in the ActiveWorkbook
in the following manner
A1 B1
File 1 x y
File 2 y z
File 3 w m

Thank you
Igor



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieve unsaved file King Cole Excel Discussion (Misc queries) 1 May 30th 07 09:44 PM
retrieve an old file erased by saving a new file with same name Nagesh Adoni Excel Discussion (Misc queries) 1 March 28th 07 02:45 PM
If I accidently replace a saved file can I retrieve the old file? kamabiv Excel Discussion (Misc queries) 1 May 11th 05 10:26 PM
Anyone know how to retrieve a deleted file (file has a name, comp. Patinak New Users to Excel 2 April 3rd 05 08:53 PM
retrieve value in file (NO VBA) Mire Excel Programming 7 September 4th 03 05:07 PM


All times are GMT +1. The time now is 02:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"