Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Variable For Worksheet Name

Iam using the following Formula:

=VLOOKUP($W$5,'[2004 Rush Offensive Stats.xls]Game 37'!$B$2:$AO$100,37,FALSE)

Where "Game 47 " is the name of a workbook in a specific workbook, I would
like to have the number "47" as a variable.

If I try:
=VLOOKUP($W$5,'[2004 Rush Offensive Stats.xls]Game
(RIGHT(B47,2))'!$B$2:$AO$100,37,FALSE)

OR

=VLOOKUP($W$5,'[2004 Rush Offensive Stats.xls]Game
&AP47'!$B$2:$AO$100,37,FALSE)

I get a "Foirmula contains an invalid reference", How can I get "Game *" to
be a variable without an error?

Thanks in advance!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Variable For Worksheet Name

Try

=VLOOKUP($W$5,INDIRECT("'[2004 Rush Offensive
Stats.xls]"&RIGHT(B47,2)&"!$B$2:$AO$100"),37,FALSE)


--
HTH

Bob Phillips

"ParTeeGolfer" wrote in message
...
Iam using the following Formula:

=VLOOKUP($W$5,'[2004 Rush Offensive Stats.xls]Game

37'!$B$2:$AO$100,37,FALSE)

Where "Game 47 " is the name of a workbook in a specific workbook, I would
like to have the number "47" as a variable.

If I try:
=VLOOKUP($W$5,'[2004 Rush Offensive Stats.xls]Game
(RIGHT(B47,2))'!$B$2:$AO$100,37,FALSE)

OR

=VLOOKUP($W$5,'[2004 Rush Offensive Stats.xls]Game
&AP47'!$B$2:$AO$100,37,FALSE)

I get a "Foirmula contains an invalid reference", How can I get "Game *"

to
be a variable without an error?

Thanks in advance!




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Variable For Worksheet Name

Thanks Bob,

However this did not work. It seems that the workshhet did not even
recognise this as a formula.

Any other suggestions?

"Bob Phillips" wrote:

Try

=VLOOKUP($W$5,INDIRECT("'[2004 Rush Offensive
Stats.xls]"&RIGHT(B47,2)&"!$B$2:$AO$100"),37,FALSE)


--
HTH

Bob Phillips

"ParTeeGolfer" wrote in message
...
Iam using the following Formula:

=VLOOKUP($W$5,'[2004 Rush Offensive Stats.xls]Game

37'!$B$2:$AO$100,37,FALSE)

Where "Game 47 " is the name of a workbook in a specific workbook, I would
like to have the number "47" as a variable.

If I try:
=VLOOKUP($W$5,'[2004 Rush Offensive Stats.xls]Game
(RIGHT(B47,2))'!$B$2:$AO$100,37,FALSE)

OR

=VLOOKUP($W$5,'[2004 Rush Offensive Stats.xls]Game
&AP47'!$B$2:$AO$100,37,FALSE)

I get a "Foirmula contains an invalid reference", How can I get "Game *"

to
be a variable without an error?

Thanks in advance!





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Variable For Worksheet Name

The only thing I can think of is that it should use B47 not Right(B47,2)
which I just copied from your formula.

--
HTH

Bob Phillips

"ParTeeGolfer" wrote in message
...
Thanks Bob,

However this did not work. It seems that the workshhet did not even
recognise this as a formula.

Any other suggestions?

"Bob Phillips" wrote:

Try

=VLOOKUP($W$5,INDIRECT("'[2004 Rush Offensive
Stats.xls]"&RIGHT(B47,2)&"!$B$2:$AO$100"),37,FALSE)


--
HTH

Bob Phillips

"ParTeeGolfer" wrote in message
...
Iam using the following Formula:

=VLOOKUP($W$5,'[2004 Rush Offensive Stats.xls]Game

37'!$B$2:$AO$100,37,FALSE)

Where "Game 47 " is the name of a workbook in a specific workbook, I

would
like to have the number "47" as a variable.

If I try:
=VLOOKUP($W$5,'[2004 Rush Offensive Stats.xls]Game
(RIGHT(B47,2))'!$B$2:$AO$100,37,FALSE)

OR

=VLOOKUP($W$5,'[2004 Rush Offensive Stats.xls]Game
&AP47'!$B$2:$AO$100,37,FALSE)

I get a "Foirmula contains an invalid reference", How can I get "Game

*"
to
be a variable without an error?

Thanks in advance!







  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Variable For Worksheet Name

Think Bob had a typo or two, but the advice was sound.
Assuming the Sheet name is GAME 37

and B47 contains something like ABCD37

this worked fine for me:

=VLOOKUP($W$5,INDIRECT("'[2004 Rush Offensive Stats.xls]Game
"&RIGHT(B47,2)&"'!$B$2:$AO$100"),37,FALSE)

Copied out of a cell where it was working very well.

--
Regards,
Tom Ogilvy

"ParTeeGolfer" wrote in message
...
Thanks Bob,

However this did not work. It seems that the workshhet did not even
recognise this as a formula.

Any other suggestions?

"Bob Phillips" wrote:

Try

=VLOOKUP($W$5,INDIRECT("'[2004 Rush Offensive
Stats.xls]"&RIGHT(B47,2)&"!$B$2:$AO$100"),37,FALSE)


--
HTH

Bob Phillips

"ParTeeGolfer" wrote in message
...
Iam using the following Formula:

=VLOOKUP($W$5,'[2004 Rush Offensive Stats.xls]Game

37'!$B$2:$AO$100,37,FALSE)

Where "Game 47 " is the name of a workbook in a specific workbook, I

would
like to have the number "47" as a variable.

If I try:
=VLOOKUP($W$5,'[2004 Rush Offensive Stats.xls]Game
(RIGHT(B47,2))'!$B$2:$AO$100,37,FALSE)

OR

=VLOOKUP($W$5,'[2004 Rush Offensive Stats.xls]Game
&AP47'!$B$2:$AO$100,37,FALSE)

I get a "Foirmula contains an invalid reference", How can I get "Game

*"
to
be a variable without an error?

Thanks in advance!







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
Link variable data from one worksheet to another worksheet? T MAT New Users to Excel 3 November 27th 07 06:46 AM
Variable worksheet name (tab) linked to cell in same worksheet azbob Excel Worksheet Functions 6 January 9th 07 06:27 PM
Looking up a variable in one worksheet and copying information from another column to another worksheet?? Brad Torken Excel Discussion (Misc queries) 2 December 10th 06 06:02 AM
Variable worksheet name Chris Excel Worksheet Functions 1 April 24th 06 05:35 PM
Assigning worksheet to worksheet variable PO Excel Programming 3 February 10th 04 02:22 PM


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