View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Leith Ross Leith Ross is offline
external usenet poster
 
Posts: 1
Default External reference to spreadsheet names (tabs) help needed.


Hello cuyuni,

Here is the code for a UDF (User Defined Function) that will
automatically update the link when the Worksheet name is changed. Paste
this code into a VBA module in Workbook1. If you need help with
installing a Module in the Workbook, let me know in your next post.


Code:
--------------------
Function LinkCells(Control_Cell As Range)

Application.Volatile
LinkCells = Control_Cell.Value

End Function
--------------------


For example let's say A1 on Worksheet1 is to be linked to D1 on
Worksheet2...

A1 would intially contain =LinkCells(Sheet2!D1)

Now, let's change Worksheet2's name to "clac's"...

A1 will now update and contain =LinkCells('calc"s'!A1)

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=561669