Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Retrieving Cell Data From Variable Files

Okay, this is what I'm trying to do.

I would like to create a log that would track changes from other files. This
log file would know the file names based on other information in the log. I
would like to do it this way so I won't have to change every line of the
log. Is there a way to place a type of "=d2" formula when looking into
another file?

For example, For Cell A2, I want it to get the file from:

C:\Files\Subfolder\FileName.xls

"Subfolder" will be whatever is listed in cell D2
"File Name" will actually be what is listed in cell E2 + cell F2
And then inside that file, I'll want it to come back with Cell A1 (or
whatever).

Is this possible?

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bj bj is offline
external usenet poster
 
Posts: 1,397
Default Retrieving Cell Data From Variable Files

try
=indirect("[C\Files"&d2&"\"&E2&F2&"]"&"Sheet1!A1")

"DJ Pomeroy" wrote:

Okay, this is what I'm trying to do.

I would like to create a log that would track changes from other files. This
log file would know the file names based on other information in the log. I
would like to do it this way so I won't have to change every line of the
log. Is there a way to place a type of "=d2" formula when looking into
another file?

For example, For Cell A2, I want it to get the file from:

C:\Files\Subfolder\FileName.xls

"Subfolder" will be whatever is listed in cell D2
"File Name" will actually be what is listed in cell E2 + cell F2
And then inside that file, I'll want it to come back with Cell A1 (or
whatever).

Is this possible?


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default Retrieving Cell Data From Variable Files

DJ,

Note that the INDIRECT method won't work on closed files. But one way that will work is to create
the referencing formulas with formulas, and then using a macro to convert to actual formulas. For
example, to pull cell D2:


In cell A2, use the formula

="='C:\Files\" & D2 & "\[" & E2 & "]" &F2 & "'!D2"

In cell D2, put the foldername.

In cell E2, put the filename, including the .xls

In cell F2, put the sheet name

Then copy those cells down as far as you need.

Then select the cells in column F, and run this macro:


Sub ConvStringToFormula()
Dim myCell As Range
For Each myCell In Selection
myCell.Formula = myCell.Text
Next
End Sub

HTH,
Bernie
MS Excel MVP



"DJ Pomeroy" wrote in message
...
Okay, this is what I'm trying to do.

I would like to create a log that would track changes from other files. This log file would know
the file names based on other information in the log. I would like to do it this way so I won't
have to change every line of the log. Is there a way to place a type of "=d2" formula when looking
into another file?

For example, For Cell A2, I want it to get the file from:

C:\Files\Subfolder\FileName.xls

"Subfolder" will be whatever is listed in cell D2
"File Name" will actually be what is listed in cell E2 + cell F2
And then inside that file, I'll want it to come back with Cell A1 (or whatever).

Is this possible?



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bj bj is offline
external usenet poster
 
Posts: 1,397
Default Retrieving Cell Data From Variable Files

Smooth, I like it
"Bernie Deitrick" wrote:

DJ,

Note that the INDIRECT method won't work on closed files. But one way that will work is to create
the referencing formulas with formulas, and then using a macro to convert to actual formulas. For
example, to pull cell D2:


In cell A2, use the formula

="='C:\Files\" & D2 & "\[" & E2 & "]" &F2 & "'!D2"

In cell D2, put the foldername.

In cell E2, put the filename, including the .xls

In cell F2, put the sheet name

Then copy those cells down as far as you need.

Then select the cells in column F, and run this macro:


Sub ConvStringToFormula()
Dim myCell As Range
For Each myCell In Selection
myCell.Formula = myCell.Text
Next
End Sub

HTH,
Bernie
MS Excel MVP



"DJ Pomeroy" wrote in message
...
Okay, this is what I'm trying to do.

I would like to create a log that would track changes from other files. This log file would know
the file names based on other information in the log. I would like to do it this way so I won't
have to change every line of the log. Is there a way to place a type of "=d2" formula when looking
into another file?

For example, For Cell A2, I want it to get the file from:

C:\Files\Subfolder\FileName.xls

"Subfolder" will be whatever is listed in cell D2
"File Name" will actually be what is listed in cell E2 + cell F2
And then inside that file, I'll want it to come back with Cell A1 (or whatever).

Is this possible?




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
retrieving data Jess Excel Worksheet Functions 1 February 13th 07 04:54 PM
Reading Data from another workbook... depending on variable in a cell? Rob Moyle Excel Discussion (Misc queries) 4 March 13th 06 04:21 PM
Retrieving data from the web - help ! glynny Excel Worksheet Functions 0 February 20th 06 02:04 AM
Input Cell in One variable data table Dottore Magistrale Excel Worksheet Functions 0 August 30th 05 06:25 PM
Retrieving deleted Excel files/worksheets Central Excel Discussion (Misc queries) 1 April 20th 05 09:14 AM


All times are GMT +1. The time now is 07:03 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"