Help with using names and variables in a function call 
Author Message
 Help with using names and variables in a function call

Hi there,

I've never done much with Excel before and I've got a
problem.  I have named two cells, one InputDwg and another
InputTab.  The InputDwg "field" is used to input what
drawing filename I'm searching for.  The InputTab field is
a range of cells assigned a name in which to search for
the drawing name.  This is a function I've set up in my
spreadsheet:

=VLOOKUP(InputDwg,InputTab,2,FALSE)

For InputDwg = P680-3.xvw, InputTab=Perry040401, I get #NA
returned.  It should return the date 03/28/01.

However, with this function:

=VLOOKUP(InputDwg,Perry040401,2,FALSE)

where InputDwg is =P680-3.xvw and where the range name
is "hardcoded" into the function, it works fine.  I get
the date 03/28/01 as expected.

I want to automate this search as much as possible--I
would rather input a value into a cell than change the
function repeatedly.  Why isn't this working?  Is it
because a name is referencing another name (Name
<InputTab> references Name <Perry040401>)?  Is there any
way around this?  

As additional background, the range named Perry040401 is
on one worksheet.  There are other worksheets & ranges
similarly named, like worksheet Perry060501 and its
selected range named likewise, etc. I know it's not
because the worksheet & range are named the same--I
already tried that.

Thanks for any help,

Cindy



Fri, 16 Jan 2004 21:33:05 GMT  
 Help with using names and variables in a function call
Try using the INDIRECT() function:

   =VLOOKUP(InputDwg,INDIRECT(InputTab),2,FALSE)


Quote:

> Hi there,

> I've never done much with Excel before and I've got a
> problem.  I have named two cells, one InputDwg and another
> InputTab.  The InputDwg "field" is used to input what
> drawing filename I'm searching for.  The InputTab field is
> a range of cells assigned a name in which to search for
> the drawing name.  This is a function I've set up in my
> spreadsheet:

> =VLOOKUP(InputDwg,InputTab,2,FALSE)

> For InputDwg = P680-3.xvw, InputTab=Perry040401, I get #NA
> returned.  It should return the date 03/28/01.

> However, with this function:

> =VLOOKUP(InputDwg,Perry040401,2,FALSE)

> where InputDwg is =P680-3.xvw and where the range name
> is "hardcoded" into the function, it works fine.  I get
> the date 03/28/01 as expected.

> I want to automate this search as much as possible--I
> would rather input a value into a cell than change the
> function repeatedly.  Why isn't this working?  Is it
> because a name is referencing another name (Name
> <InputTab> references Name <Perry040401>)?  Is there any
> way around this?  

> As additional background, the range named Perry040401 is
> on one worksheet.  There are other worksheets & ranges
> similarly named, like worksheet Perry060501 and its
> selected range named likewise, etc. I know it's not
> because the worksheet & range are named the same--I
> already tried that.

> Thanks for any help,

> Cindy

--

ROT13 encoding, decode for real mail


Fri, 16 Jan 2004 21:55:21 GMT  
 Help with using names and variables in a function call
WOW!!  That was so fast!  It took me longer to type my
question than to get the answer.  It works PERFECTLY!

THANKS!!!!  You're a genius and a lifesaver!

Cindy

Quote:
>-----Original Message-----
>Try using the INDIRECT() function:

>   =VLOOKUP(InputDwg,INDIRECT(InputTab),2,FALSE)



>> Hi there,

>> I've never done much with Excel before and I've got a
>> problem.  I have named two cells, one InputDwg and
another
>> InputTab.  The InputDwg "field" is used to input what
>> drawing filename I'm searching for.  The InputTab field
is
>> a range of cells assigned a name in which to search for
>> the drawing name.  This is a function I've set up in my
>> spreadsheet:

>> =VLOOKUP(InputDwg,InputTab,2,FALSE)

>> For InputDwg = P680-3.xvw, InputTab=Perry040401, I get
#NA
>> returned.  It should return the date 03/28/01.

>> However, with this function:

>> =VLOOKUP(InputDwg,Perry040401,2,FALSE)

>> where InputDwg is =P680-3.xvw and where the range name
>> is "hardcoded" into the function, it works fine.  I get
>> the date 03/28/01 as expected.

>> I want to automate this search as much as possible--I
>> would rather input a value into a cell than change the
>> function repeatedly.  Why isn't this working?  Is it
>> because a name is referencing another name (Name
>> <InputTab> references Name <Perry040401>)?  Is there
any
>> way around this?  

>> As additional background, the range named Perry040401
is
>> on one worksheet.  There are other worksheets & ranges
>> similarly named, like worksheet Perry060501 and its
>> selected range named likewise, etc. I know it's not
>> because the worksheet & range are named the same--I
>> already tried that.

>> Thanks for any help,

>> Cindy

>--

>ROT13 encoding, decode for real mail
>.



Fri, 16 Jan 2004 22:22:47 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Call Function using Func Name stored in variable

2. Help Using Variable To Call a Procedure or function

3. Help -- Using variables for Function names...

4. how do i call a function by using the function name as a string of characters

5. Calling function or sub with variable array or string names

6. Call a function with a variable name

7. Calling a procedure using a variable name

8. Call Let/Get Prop using string variable for name

9. Call Let/Get Prop using string variable for name

10. Call a proc using a string variable for the proc name


 
Powered by phpBB® Forum Software © phpBB Group