Posted to microsoft.public.excel.programming
|
|
reutrn a value from a cell in each workbook filename from anot
Hi Narasimha, take a look at this site and see if this is what you want to do.
http://www.exceltip.com/st/Getting_V...Excel/357.html
Be sure you get the whole address, including line wrap.
"Narasimha" wrote:
Hi Carlo, could you please explain briefly because this could be useful to me
or
please go through the question which I was posted few hours ago in excel
general questions at 4.21pm subjected reference
"Hi all ,
I am basic excel user.
I have some excel files, say Book1,Book2 etc in C:\Temp folder.
In another excel file say Book3 , When I enter Book1 or Book2 in cell A1 ,
the cell value of Book1 or Book2 respectively should come in cell which the
formula has.
I tried with concatenate but of no use (path of excel in Column A and file
name in Column B)
Could anyone please help me ?
Thanks in advance.
Narasimha"
thank you in advance
Narasimha
"carlo" wrote:
On Nov 26, 11:04 am, Chris wrote:
hi guys. i was able to make the first step, thanks to the discussion
groups... i was able to make a list of all files located in a folder in a
single sheet (column A). now, i need to find, in each file from column A, a
certain cell within the file...
like this... in each file, i have a cell that i write as "GRAND TOTAL", and
i need to get that value, which is the one right beside the grand total cell.
i'm trying to make a summary of all computation files in that folder for
reports, wherein i just open the summary file, and everything will be
there....
how to do this?i can't figure this out...
Hi Chris
here's a short code, maybe it helps you figure out a way that works
for you:
Sub copy_cell()
Dim main_wb As Workbook
Dim xl_wb As Workbook
Set main_wb = ActiveWorkbook
For i = 1 To Cells(65536, 1).End(xlUp).Row
Set xl_wb = Workbooks.Open(main_wb.Path & "\" &
main_wb.Sheets(1).Cells(i, 1))
main_wb.Sheets(1).Cells(i, 2).Value = xl_wb.Sheets(1).Cells(8,
2).Value
xl_wb.Close (False)
Next i
End Sub
Cells(8,2) is where your grand total is located, you can also
substitute
this with Range("B8") or Range(yourdefinedRangeName).
Be careful when copying the code, it will maybe split up some lines!
hth
Carlo
|