Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Alberto Pinto
 
Posts: n/a
Default Variable Links to tabsheets

Hi!

How can I make a link to another sheet be dependable on one cell value
(without ifs)?

I give you an example:

I have a worksheet with three sheets ('Sheet1','Sheet2', and 'Sheet3')
In 'Sheet1' I have two cells:
A1 - Its value can be 'Sheet2' or 'Sheet3'
A2 - It has a formula (for example: 'Sheet2'!B1)

I would like to make a formula like this one for cell A2: *A1*!B1
and the Excel to "substitute" the * for Sheet2 or Sheet3 depending on
the value in A1.

I hope i explained it ok.

Thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
rsenn
 
Posts: n/a
Default Variable Links to tabsheets


How about using a simple if statement


If (A1 ="Sheet2",'Sheet2'!A1*'Sheet2'B1,'Sheet3'!A1*'Shee t3'!B1)


--
rsenn
------------------------------------------------------------------------
rsenn's Profile: http://www.excelforum.com/member.php...o&userid=29050
View this thread: http://www.excelforum.com/showthread...hreadid=487830

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max
 
Posts: n/a
Default Variable Links to tabsheets

Think you're looking for INDIRECT ..

Put in A1: Sheet2
Put in A2: =INDIRECT("'"& A1 &"'!B1")

A2 returns the same as : =Sheet2!B1

Changing the sheetname in A1 to: Sheet3
will then return the value in Sheet3's B1
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"Alberto Pinto" wrote in message
...
Hi!

How can I make a link to another sheet be dependable on one cell value
(without ifs)?

I give you an example:

I have a worksheet with three sheets ('Sheet1','Sheet2', and 'Sheet3')
In 'Sheet1' I have two cells:
A1 - Its value can be 'Sheet2' or 'Sheet3'
A2 - It has a formula (for example: 'Sheet2'!B1)

I would like to make a formula like this one for cell A2: *A1*!B1
and the Excel to "substitute" the * for Sheet2 or Sheet3 depending on
the value in A1.

I hope i explained it ok.

Thanks in advance



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
noyb
 
Posts: n/a
Default Variable Links to tabsheets

Please, what does the ' as in ("'" do in this formula
Thanks

Max wrote:
Think you're looking for INDIRECT ..

Put in A1: Sheet2
Put in A2: =INDIRECT("'"& A1 &"'!B1")

A2 returns the same as : =Sheet2!B1

Changing the sheetname in A1 to: Sheet3
will then return the value in Sheet3's B1
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"Alberto Pinto" wrote in message
...

Hi!

How can I make a link to another sheet be dependable on one cell value
(without ifs)?

I give you an example:

I have a worksheet with three sheets ('Sheet1','Sheet2', and 'Sheet3')
In 'Sheet1' I have two cells:
A1 - Its value can be 'Sheet2' or 'Sheet3'
A2 - It has a formula (for example: 'Sheet2'!B1)

I would like to make a formula like this one for cell A2: *A1*!B1
and the Excel to "substitute" the * for Sheet2 or Sheet3 depending on
the value in A1.

I hope i explained it ok.

Thanks in advance




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max
 
Posts: n/a
Default Variable Links to tabsheets

"noyb" wrote
.. what does the ' as in ("'" do in this formula ..


The single quotes / apostrophes (there's actually a pair of them) allows
any worksheet name to be accommodated in A1

Best that I quote this advisory from a post by Harlan:

".. *ALWAYS* (and I *DO* mean **ALWAYS**) include single quotes around
worksheet names when constructing textrefs inside INDIRECT calls. The result
is far more robust since without them worksheet names that contain spaces or
exclamation points (along with a few others that require single quote
delimiters) will choke INDIRECT so that it returns #REF!. Even if the
worksheet name doesn't require single quote delimiters, no harm done adding
them. .. "
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
noyb
 
Posts: n/a
Default Variable Links to tabsheets

Thanks

Max wrote:
"noyb" wrote

.. what does the ' as in ("'" do in this formula ..



The single quotes / apostrophes (there's actually a pair of them) allows
any worksheet name to be accommodated in A1

Best that I quote this advisory from a post by Harlan:

".. *ALWAYS* (and I *DO* mean **ALWAYS**) include single quotes around
worksheet names when constructing textrefs inside INDIRECT calls. The result
is far more robust since without them worksheet names that contain spaces or
exclamation points (along with a few others that require single quote
delimiters) will choke INDIRECT so that it returns #REF!. Even if the
worksheet name doesn't require single quote delimiters, no harm done adding
them. .. "
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max
 
Posts: n/a
Default Variable Links to tabsheets

Delighted !
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"noyb" wrote in message
...
Thanks



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
Variable Links to Tabsheets Alberto Pinto Links and Linking in Excel 3 January 6th 06 01:01 AM
options to update automatic links Werner Rohrmoser Excel Worksheet Functions 0 November 10th 05 12:58 PM
Prompt to update links Werner Rohrmoser Links and Linking in Excel 0 November 3rd 05 09:47 AM
Deleting links to other spreadsheets KarenH Excel Worksheet Functions 2 October 28th 05 04:09 AM
Using variable in external links automne Excel Discussion (Misc queries) 1 March 6th 05 11:35 PM


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