Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 156
Default Help with MATCH function

Hi,

I have a worksheet function (in fact hundreds!) like this:

=MATCH("Basis B", 'C:\SRCPath\20061017\[ExportFUND.xls]Export'!$E$7:$Z$7,0)

This returns the column that another cell uses in an ADDRESS function with
INDIRECT to return a value from another workbook.

Basis B comes from the column Header
C:\SRCPath\ is the same as a cell called 'MasterPath' - but is static
20061017 comes from a cell called 'ExportDate'
FUND comes from column B on the same row as the function

So, is there any way to derive the path dynamically, in other words, when
the cell called 'ExportDate' changes, or when the cell called 'MasterPath'
changes, currently I have code running in the Worksheet_Change event to
update all the formulae with the new Path and the date ...

I have tried to do something like this:

MasterPath&"[Export"&B17&".xls]Export'!"

then tack on the search range at the end so it looks like this

="'"&MasterPath&"[Export"&B17&".xls]Export'!$E$7:$Z$7"

but when I put that into my final formula:
=MATCH("Basis B","'"&MasterPath&"[Export"&B16&".xls]Export'!$E$7:$Z$7",0)

it always fails to evaluate and I get a #VALUE error.

So, that's the challenge - is there anyway to derive the oath to the MATCH
function from other cells like that?

I works fine using the macro in the change event of course, but if possible
I'd prefer to have a worksheet function managing to workout the path itself!

Thanks for any help

Philip
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 751
Default Help with MATCH function

Does the following work? Sorry, could not test.

=MATCH("Basis B",
INDIRECT("'"&MasterPath&"\"&ExportDate&"\[Export"&INDIRECT(ADDRESS(SUM(ROW()),2))&".xls]Export'!$E$7:$Z$7",0)

HTH
Kostis Vezerides


Philip wrote:
Hi,

I have a worksheet function (in fact hundreds!) like this:

=MATCH("Basis B", 'C:\SRCPath\20061017\[ExportFUND.xls]Export'!$E$7:$Z$7,0)

This returns the column that another cell uses in an ADDRESS function with
INDIRECT to return a value from another workbook.

Basis B comes from the column Header
C:\SRCPath\ is the same as a cell called 'MasterPath' - but is static
20061017 comes from a cell called 'ExportDate'
FUND comes from column B on the same row as the function

So, is there any way to derive the path dynamically, in other words, when
the cell called 'ExportDate' changes, or when the cell called 'MasterPath'
changes, currently I have code running in the Worksheet_Change event to
update all the formulae with the new Path and the date ...

I have tried to do something like this:

MasterPath&"[Export"&B17&".xls]Export'!"

then tack on the search range at the end so it looks like this

="'"&MasterPath&"[Export"&B17&".xls]Export'!$E$7:$Z$7"

but when I put that into my final formula:
=MATCH("Basis B","'"&MasterPath&"[Export"&B16&".xls]Export'!$E$7:$Z$7",0)

it always fails to evaluate and I get a #VALUE error.

So, that's the challenge - is there anyway to derive the oath to the MATCH
function from other cells like that?

I works fine using the macro in the change event of course, but if possible
I'd prefer to have a worksheet function managing to workout the path itself!

Thanks for any help

Philip


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Help with MATCH function

=indirect() will only work if the sending workbook is open.

vezerid wrote:

Does the following work? Sorry, could not test.

=MATCH("Basis B",
INDIRECT("'"&MasterPath&"\"&ExportDate&"\[Export"&INDIRECT(ADDRESS(SUM(ROW()),2))&".xls]Export'!$E$7:$Z$7",0)

HTH
Kostis Vezerides

Philip wrote:
Hi,

I have a worksheet function (in fact hundreds!) like this:

=MATCH("Basis B", 'C:\SRCPath\20061017\[ExportFUND.xls]Export'!$E$7:$Z$7,0)

This returns the column that another cell uses in an ADDRESS function with
INDIRECT to return a value from another workbook.

Basis B comes from the column Header
C:\SRCPath\ is the same as a cell called 'MasterPath' - but is static
20061017 comes from a cell called 'ExportDate'
FUND comes from column B on the same row as the function

So, is there any way to derive the path dynamically, in other words, when
the cell called 'ExportDate' changes, or when the cell called 'MasterPath'
changes, currently I have code running in the Worksheet_Change event to
update all the formulae with the new Path and the date ...

I have tried to do something like this:

MasterPath&"[Export"&B17&".xls]Export'!"

then tack on the search range at the end so it looks like this

="'"&MasterPath&"[Export"&B17&".xls]Export'!$E$7:$Z$7"

but when I put that into my final formula:
=MATCH("Basis B","'"&MasterPath&"[Export"&B16&".xls]Export'!$E$7:$Z$7",0)

it always fails to evaluate and I get a #VALUE error.

So, that's the challenge - is there anyway to derive the oath to the MATCH
function from other cells like that?

I works fine using the macro in the change event of course, but if possible
I'd prefer to have a worksheet function managing to workout the path itself!

Thanks for any help

Philip


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 156
Default Help with MATCH function

Hi,

Yes that's correct, so we're using the INDIRECT.EXT function from Laurent
Longre's Morefunc.xll

it works the same but with closed workbooks... until I can persuede
Microsoft to change it in Excel 2007 !

Philip

"Dave Peterson" wrote:

=indirect() will only work if the sending workbook is open.

vezerid wrote:

Does the following work? Sorry, could not test.

=MATCH("Basis B",
INDIRECT("'"&MasterPath&"\"&ExportDate&"\[Export"&INDIRECT(ADDRESS(SUM(ROW()),2))&".xls]Export'!$E$7:$Z$7",0)

HTH
Kostis Vezerides

Philip wrote:
Hi,

I have a worksheet function (in fact hundreds!) like this:

=MATCH("Basis B", 'C:\SRCPath\20061017\[ExportFUND.xls]Export'!$E$7:$Z$7,0)

This returns the column that another cell uses in an ADDRESS function with
INDIRECT to return a value from another workbook.

Basis B comes from the column Header
C:\SRCPath\ is the same as a cell called 'MasterPath' - but is static
20061017 comes from a cell called 'ExportDate'
FUND comes from column B on the same row as the function

So, is there any way to derive the path dynamically, in other words, when
the cell called 'ExportDate' changes, or when the cell called 'MasterPath'
changes, currently I have code running in the Worksheet_Change event to
update all the formulae with the new Path and the date ...

I have tried to do something like this:

MasterPath&"[Export"&B17&".xls]Export'!"

then tack on the search range at the end so it looks like this

="'"&MasterPath&"[Export"&B17&".xls]Export'!$E$7:$Z$7"

but when I put that into my final formula:
=MATCH("Basis B","'"&MasterPath&"[Export"&B16&".xls]Export'!$E$7:$Z$7",0)

it always fails to evaluate and I get a #VALUE error.

So, that's the challenge - is there anyway to derive the oath to the MATCH
function from other cells like that?

I works fine using the macro in the change event of course, but if possible
I'd prefer to have a worksheet function managing to workout the path itself!

Thanks for any help

Philip


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 156
Default Help with MATCH function

no, it seems I am stuck building the formula using code in the event...

There's always some problem with the quotes...

"vezerid" wrote:

Does the following work? Sorry, could not test.

=MATCH("Basis B",
INDIRECT("'"&MasterPath&"\"&ExportDate&"\[Export"&INDIRECT(ADDRESS(SUM(ROW()),2))&".xls]Export'!$E$7:$Z$7",0)

HTH
Kostis Vezerides


Philip wrote:
Hi,

I have a worksheet function (in fact hundreds!) like this:

=MATCH("Basis B", 'C:\SRCPath\20061017\[ExportFUND.xls]Export'!$E$7:$Z$7,0)

This returns the column that another cell uses in an ADDRESS function with
INDIRECT to return a value from another workbook.

Basis B comes from the column Header
C:\SRCPath\ is the same as a cell called 'MasterPath' - but is static
20061017 comes from a cell called 'ExportDate'
FUND comes from column B on the same row as the function

So, is there any way to derive the path dynamically, in other words, when
the cell called 'ExportDate' changes, or when the cell called 'MasterPath'
changes, currently I have code running in the Worksheet_Change event to
update all the formulae with the new Path and the date ...

I have tried to do something like this:

MasterPath&"[Export"&B17&".xls]Export'!"

then tack on the search range at the end so it looks like this

="'"&MasterPath&"[Export"&B17&".xls]Export'!$E$7:$Z$7"

but when I put that into my final formula:
=MATCH("Basis B","'"&MasterPath&"[Export"&B16&".xls]Export'!$E$7:$Z$7",0)

it always fails to evaluate and I get a #VALUE error.

So, that's the challenge - is there anyway to derive the oath to the MATCH
function from other cells like that?

I works fine using the macro in the change event of course, but if possible
I'd prefer to have a worksheet function managing to workout the path itself!

Thanks for any help

Philip





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 751
Default Help with MATCH function

If you want to use this formula in VBA code you can use the following:
1. Gradually build the string.
2. Use "" inside double quotes to express "

HTH
Kostis Vezerides


Philip wrote:
no, it seems I am stuck building the formula using code in the event...

There's always some problem with the quotes...

"vezerid" wrote:

Does the following work? Sorry, could not test.

=MATCH("Basis B",
INDIRECT("'"&MasterPath&"\"&ExportDate&"\[Export"&INDIRECT(ADDRESS(SUM(ROW()),2))&".xls]Export'!$E$7:$Z$7",0)

HTH
Kostis Vezerides


Philip wrote:
Hi,

I have a worksheet function (in fact hundreds!) like this:

=MATCH("Basis B", 'C:\SRCPath\20061017\[ExportFUND.xls]Export'!$E$7:$Z$7,0)

This returns the column that another cell uses in an ADDRESS function with
INDIRECT to return a value from another workbook.

Basis B comes from the column Header
C:\SRCPath\ is the same as a cell called 'MasterPath' - but is static
20061017 comes from a cell called 'ExportDate'
FUND comes from column B on the same row as the function

So, is there any way to derive the path dynamically, in other words, when
the cell called 'ExportDate' changes, or when the cell called 'MasterPath'
changes, currently I have code running in the Worksheet_Change event to
update all the formulae with the new Path and the date ...

I have tried to do something like this:

MasterPath&"[Export"&B17&".xls]Export'!"

then tack on the search range at the end so it looks like this

="'"&MasterPath&"[Export"&B17&".xls]Export'!$E$7:$Z$7"

but when I put that into my final formula:
=MATCH("Basis B","'"&MasterPath&"[Export"&B16&".xls]Export'!$E$7:$Z$7",0)

it always fails to evaluate and I get a #VALUE error.

So, that's the challenge - is there anyway to derive the oath to the MATCH
function from other cells like that?

I works fine using the macro in the change event of course, but if possible
I'd prefer to have a worksheet function managing to workout the path itself!

Thanks for any help

Philip




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
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Need some comments on my Utility_Move class module. jchen Excel Worksheet Functions 0 August 21st 06 07:05 PM
MATCH function, exclusion question Paul Lautman Excel Discussion (Misc queries) 4 July 21st 06 04:53 AM
Excel option to store trendline's coefficients in cells for use Miguel Saldana Charts and Charting in Excel 9 June 20th 05 08:45 PM
I want to use the MATCH function with the AVERAGE function but I . Miguel Excel Worksheet Functions 2 April 23rd 05 05:29 PM


All times are GMT +1. The time now is 08:54 PM.

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"