Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Ken Ken is offline
external usenet poster
 
Posts: 590
Default Return portion of Formula?

Excel2003 ... Range D15:D54 now contains formulas similar to:

Cell D15 contains ... =MAX('Simpson, F'!R$15:R$300)
Cell D16 contains ... =MAX('Clause, S'!R$15:R$300))
Cell D17 contains ... =MAX('Alonglastname, C'!R$15:R$300))
etc (Name of WS chgs on each Row)

In Range A15:A54 ... I would like a Formula that will return the WS Name
contained in formula Range D15:D54.

A15 return "Simpson, F"
A16 return "Clause, S"
A17 return "Averylonglastname, C"

Thanks ... Kha

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Return portion of Formula?

Try this one-line UDF:

Function sheetref(r As Range) As String
sheetref = Split(r.Formula, "'")(1)
End Function


UDFs are very easy to install and use:

1. ALT-F11 brings up the VBE window
2. ALT-I
ALT-M opens a fresh module
3. paste the stuff in and close the VBE window

If you save the workbook, the UDF will be saved with it.

To use the UDF from the normal Excel window, just enter it like a normal
Excel Function, for example =sheetref(D15)

To remove the UDF:

1. bring up the VBE window as above
2. clear the code out
3. close the VBE window

To learn more about UDFs, see:

http://www.cpearson.com/excel/Writin...ionsInVBA.aspx


--
Gary''s Student - gsnu200824


"Ken" wrote:

Excel2003 ... Range D15:D54 now contains formulas similar to:

Cell D15 contains ... =MAX('Simpson, F'!R$15:R$300)
Cell D16 contains ... =MAX('Clause, S'!R$15:R$300))
Cell D17 contains ... =MAX('Alonglastname, C'!R$15:R$300))
etc (Name of WS chgs on each Row)

In Range A15:A54 ... I would like a Formula that will return the WS Name
contained in formula Range D15:D54.

A15 return "Simpson, F"
A16 return "Clause, S"
A17 return "Averylonglastname, C"

Thanks ... Kha

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
Formula to multiply only a portion of a cell number? zsboppie Excel Worksheet Functions 4 June 3rd 08 10:06 PM
Extract portion of formula resident in a cell JASelep Excel Worksheet Functions 2 August 29th 07 04:25 PM
A formula for moving a portion of a cell??? McKenna Excel Discussion (Misc queries) 4 February 20th 07 10:23 PM
return a portion of data entered into a cell Brian Excel Discussion (Misc queries) 1 January 9th 07 03:46 AM
how do i extend the series of a portion of a formula? fraustrated Excel Worksheet Functions 2 April 21st 05 10:07 PM


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