#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 788
Default Name Defining

Howcome when I go to add a new name in the name---define box, excel
automatically adds the sheet name to my formula? I'm trying to run a macro by
using the name define function but it won't work for different workbooks
because they all have different sheet names and hence aren't referenced
properly. Is there a way to get around this?


For example this is the formula that I'm entering in the name define box (I
know its huge)

=OFFSET(INDIRECT("$A$"&(MATCH("Run",$A:$A,0)+1)),0 ,0,(COUNTIF($A:$A,1)+COUNTIF($A:$A,2)),3)

and here's what excel is automatically doing..........

=OFFSET(INDIRECT("$A$"&(MATCH("Run",Testing_Macro! $A:$A,0)+1)),0,0,(COUNTIF(Testing_Macro!$A:$A,1)+C OUNTIF(Testing_Macro!$A:$A,2)),3)


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,718
Default Name Defining

Try more INDIRECTs. Whether this will work in practice you'll have to
investigate:

=OFFSET(INDIRECT("$A$"&(MATCH("Run",INDIRECT("$A:$ A"),0)+1)),0,0,(COUNTIF(INDIRECT("$A:$A"),1)+COUNT IF(INDIRECT("$A:$A"),2)),3)

--
Jim
"Chris" wrote in message
...
| Howcome when I go to add a new name in the name---define box, excel
| automatically adds the sheet name to my formula? I'm trying to run a macro
by
| using the name define function but it won't work for different workbooks
| because they all have different sheet names and hence aren't referenced
| properly. Is there a way to get around this?
|
|
| For example this is the formula that I'm entering in the name define box
(I
| know its huge)
|
|
=OFFSET(INDIRECT("$A$"&(MATCH("Run",$A:$A,0)+1)),0 ,0,(COUNTIF($A:$A,1)+COUNTIF($A:$A,2)),3)
|
| and here's what excel is automatically doing..........
|
|
=OFFSET(INDIRECT("$A$"&(MATCH("Run",Testing_Macro! $A:$A,0)+1)),0,0,(COUNTIF(Testing_Macro!$A:$A,1)+C OUNTIF(Testing_Macro!$A:$A,2)),3)
|
|


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 788
Default Name Defining

It worked, you're a life saver!

Thank you

"Jim Rech" wrote:

Try more INDIRECTs. Whether this will work in practice you'll have to
investigate:

=OFFSET(INDIRECT("$A$"&(MATCH("Run",INDIRECT("$A:$ A"),0)+1)),0,0,(COUNTIF(INDIRECT("$A:$A"),1)+COUNT IF(INDIRECT("$A:$A"),2)),3)

--
Jim
"Chris" wrote in message
...
| Howcome when I go to add a new name in the name---define box, excel
| automatically adds the sheet name to my formula? I'm trying to run a macro
by
| using the name define function but it won't work for different workbooks
| because they all have different sheet names and hence aren't referenced
| properly. Is there a way to get around this?
|
|
| For example this is the formula that I'm entering in the name define box
(I
| know its huge)
|
|
=OFFSET(INDIRECT("$A$"&(MATCH("Run",$A:$A,0)+1)),0 ,0,(COUNTIF($A:$A,1)+COUNTIF($A:$A,2)),3)
|
| and here's what excel is automatically doing..........
|
|
=OFFSET(INDIRECT("$A$"&(MATCH("Run",Testing_Macro! $A:$A,0)+1)),0,0,(COUNTIF(Testing_Macro!$A:$A,1)+C OUNTIF(Testing_Macro!$A:$A,2)),3)
|
|



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
Defining Range within Specific Dates Cardan Excel Worksheet Functions 0 July 26th 06 08:17 PM
Defining a range using a cell reference jagbabbra Excel Worksheet Functions 5 June 5th 06 01:36 PM
Defining "Month" as a variable in VBA Colin Vicary Excel Discussion (Misc queries) 2 February 22nd 06 05:58 PM
Defining Matt Excel Discussion (Misc queries) 1 July 26th 05 08:13 PM
Shared Workbook - Defining Access Rights gizmo Excel Worksheet Functions 0 January 13th 05 04:10 PM


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