#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default Column reference

How can I find the column of a reference I have in a different worksheet?
For example in A1 I have ='D:\Work\[Vars.xls]Sheet1'!D$4 which makes
reference to column 4 in D:\Work\[Vars.xls]Sheet1. I would like to find that
column number without entering the address, since that might change. Or
associating it to A1 so that if I change A1 the column number would change
automatically.

Thank you,

Manuel
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9,101
Default Column reference

I don't know if this will help. but I wrote a neat function (only) one line
that will return the formula in an cell. You can then search the returned
string for any text you are looking for.

Function GetFormula(mycell As String) As String

GetFormula = Range(mycell).Formula
End Function


To use:

in cell A6 enter - make sure A%5 is entered as text.
=GetFormula("A5")


"manuel" wrote:

How can I find the column of a reference I have in a different worksheet?
For example in A1 I have ='D:\Work\[Vars.xls]Sheet1'!D$4 which makes
reference to column 4 in D:\Work\[Vars.xls]Sheet1. I would like to find that
column number without entering the address, since that might change. Or
associating it to A1 so that if I change A1 the column number would change
automatically.

Thank you,

Manuel

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default Column reference

Thanks. It does return the string but I cannot embed it within a column()
function - column(GetFormula("A5")) - so I cannot get the formula for the
string back. It puts me a little closer to the solution but ....

Thanks anyways.

Manuel

"Joel" wrote:

I don't know if this will help. but I wrote a neat function (only) one line
that will return the formula in an cell. You can then search the returned
string for any text you are looking for.

Function GetFormula(mycell As String) As String

GetFormula = Range(mycell).Formula
End Function


To use:

in cell A6 enter - make sure A%5 is entered as text.
=GetFormula("A5")


"manuel" wrote:

How can I find the column of a reference I have in a different worksheet?
For example in A1 I have ='D:\Work\[Vars.xls]Sheet1'!D$4 which makes
reference to column 4 in D:\Work\[Vars.xls]Sheet1. I would like to find that
column number without entering the address, since that might change. Or
associating it to A1 so that if I change A1 the column number would change
automatically.

Thank you,

Manuel

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
How to reference one column against another Ted McCastlain Excel Worksheet Functions 10 August 31st 06 10:06 PM
Column reference and column count Steve-in-austin Excel Discussion (Misc queries) 1 June 5th 06 09:23 PM
Row reference increment but preserve column reference Pwanda Excel Worksheet Functions 1 April 28th 05 01:12 PM
Macro to Reference Column Next to Current Reference dolphinv4 Excel Discussion (Misc queries) 2 April 11th 05 08:36 AM
I need to find the Average from Column A - but Reference Column B BAM718 Excel Worksheet Functions 2 March 15th 05 02:42 PM


All times are GMT +1. The time now is 12:59 AM.

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

About Us

"It's about Microsoft Excel"