Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
shakey1181
 
Posts: n/a
Default Referencing Other Files - Formula Pattern?

Apologies for my second post of the day, but I have just discovered this
resource.

The cell I am working in references data held in a file with a date-based
name. Is there any way to write the formula so when you drag it to other
cells, it goes up in equal incrimemts? So if A1 is referencing '01.01.06' how
do I set it so A2 references '02.01.06' without having to rewrite the formula
for each one?

Thanks again.
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bernie Deitrick
 
Posts: n/a
Default Referencing Other Files - Formula Pattern?

Shakey,

One way is to create the referencing formulas with formulas, and then using a macro to convert to
actual formulas. For example:

In cell A2, put the folder path:
C:\Excel\Folder\

In cell B2, put the filename
02.01.06.xls

In cell C2, put the sheetname:
Sheet2

In cell D2, put the cell address:
A2

in Cell F2, put the formula
="='"&A2 & "[" & B2 & "]" &C2 & "'!" &D2

Then copy those cells down as far as you need, and properly increment the dates in column B. (You
can use a formula to do so - just make sure that the returned value is a string.).

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


"shakey1181" wrote in message
...
Apologies for my second post of the day, but I have just discovered this
resource.

The cell I am working in references data held in a file with a date-based
name. Is there any way to write the formula so when you drag it to other
cells, it goes up in equal incrimemts? So if A1 is referencing '01.01.06' how
do I set it so A2 references '02.01.06' without having to rewrite the formula
for each one?

Thanks again.



  #3   Report Post  
Posted to microsoft.public.excel.misc
shakey1181
 
Posts: n/a
Default Referencing Other Files - Formula Pattern?

when i run this it returns an error within the macro:

myCell.Formula = myCell.Text

I don't know macros very well, but any thoughts would be great.



"Bernie Deitrick" wrote:

Shakey,

One way is to create the referencing formulas with formulas, and then using a macro to convert to
actual formulas. For example:

In cell A2, put the folder path:
C:\Excel\Folder\

In cell B2, put the filename
02.01.06.xls

In cell C2, put the sheetname:
Sheet2

In cell D2, put the cell address:
A2

in Cell F2, put the formula
="='"&A2 & "[" & B2 & "]" &C2 & "'!" &D2

Then copy those cells down as far as you need, and properly increment the dates in column B. (You
can use a formula to do so - just make sure that the returned value is a string.).

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


"shakey1181" wrote in message
...
Apologies for my second post of the day, but I have just discovered this
resource.

The cell I am working in references data held in a file with a date-based
name. Is there any way to write the formula so when you drag it to other
cells, it goes up in equal incrimemts? So if A1 is referencing '01.01.06' how
do I set it so A2 references '02.01.06' without having to rewrite the formula
for each one?

Thanks again.




  #4   Report Post  
Posted to microsoft.public.excel.misc
Bernie Deitrick
 
Posts: n/a
Default Referencing Other Files - Formula Pattern?

Shakey,

Sounds like you have an error in your formula as generated. Check your entries in A2, B2, C2, and
D2 - make sure that spaces are correct, spelling is exact, etc.

You can check your formula generation by selecting the cell with the formula, pressing F2, selecting
the entire formula in the formula edit bar, then pressing F9 and then finally pressing enter. (You
can always press Undo to get back to the original formula.) If your formula works doing that, it
should work with the macro.

HTH,
Bernie
MS Excel MVP


"shakey1181" wrote in message
...
when i run this it returns an error within the macro:

myCell.Formula = myCell.Text

I don't know macros very well, but any thoughts would be great.



"Bernie Deitrick" wrote:

Shakey,

One way is to create the referencing formulas with formulas, and then using a macro to convert to
actual formulas. For example:

In cell A2, put the folder path:
C:\Excel\Folder\

In cell B2, put the filename
02.01.06.xls

In cell C2, put the sheetname:
Sheet2

In cell D2, put the cell address:
A2

in Cell F2, put the formula
="='"&A2 & "[" & B2 & "]" &C2 & "'!" &D2

Then copy those cells down as far as you need, and properly increment the dates in column B.
(You
can use a formula to do so - just make sure that the returned value is a string.).

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


"shakey1181" wrote in message
...
Apologies for my second post of the day, but I have just discovered this
resource.

The cell I am working in references data held in a file with a date-based
name. Is there any way to write the formula so when you drag it to other
cells, it goes up in equal incrimemts? So if A1 is referencing '01.01.06' how
do I set it so A2 references '02.01.06' without having to rewrite the formula
for each one?

Thanks again.






  #5   Report Post  
Posted to microsoft.public.excel.misc
Bernie Deitrick
 
Posts: n/a
Default Referencing Other Files - Formula Pattern?

Shakey,

A good way to check your formula generation is to open the file, select your other file, type = in a
blank cell, select the source file, source sheet, and source cell, press enter, then close the
source file. The link formula should then look like

='C:\Excel\Folder\[01.05.06.xls]Sheet3'!A3

which should exactly match what is shown in your cell with the formula.

HTH,
Bernie
MS Excel MVP


"shakey1181" wrote in message
...
when i run this it returns an error within the macro:

myCell.Formula = myCell.Text

I don't know macros very well, but any thoughts would be great.



"Bernie Deitrick" wrote:

Shakey,

One way is to create the referencing formulas with formulas, and then using a macro to convert to
actual formulas. For example:

In cell A2, put the folder path:
C:\Excel\Folder\

In cell B2, put the filename
02.01.06.xls

In cell C2, put the sheetname:
Sheet2

In cell D2, put the cell address:
A2

in Cell F2, put the formula
="='"&A2 & "[" & B2 & "]" &C2 & "'!" &D2

Then copy those cells down as far as you need, and properly increment the dates in column B.
(You
can use a formula to do so - just make sure that the returned value is a string.).

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


"shakey1181" wrote in message
...
Apologies for my second post of the day, but I have just discovered this
resource.

The cell I am working in references data held in a file with a date-based
name. Is there any way to write the formula so when you drag it to other
cells, it goes up in equal incrimemts? So if A1 is referencing '01.01.06' how
do I set it so A2 references '02.01.06' without having to rewrite the formula
for each one?

Thanks again.






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
Address for Linked Files in Formula kohai Excel Worksheet Functions 1 April 12th 06 05:19 PM
Match then lookup Tenacity Excel Worksheet Functions 9 December 3rd 05 05:30 AM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 03:28 AM
referencing named formula using INDIRECT function [email protected] Excel Worksheet Functions 19 May 11th 05 09:48 AM
Cannot access read-only documents. tomgillane Excel Discussion (Misc queries) 14 February 7th 05 10:53 PM


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