Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Tab Name Reference

I am close, but no cigar. I have a formula in cell A1 that is =TestSheet!A1,
in B1 I have the following formula - =MID(CELL("filename",A1), FIND("]",
CELL("filename", A1))+ 1, 255), which results in it saying Sheet1. What I
need is for the formula in cell B1 to tell me which sheet A1 is coming from.
So ideally in B1, it would say TestSheet. Any suggestions?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,104
Default Tab Name Reference

Here is a UDF that does that

Function getname(mycell)
myform = mycell.Formula
x = InStr(1, myform, "!")
getname = Mid(myform, 2, x - 2)
End Function


David McRitchie's site on "getting started" with VBA

http://www.mvps.org/dmcritchie/excel/getstarted.htm

Debra Dalgleish's "Adding Code to a Workbook"

http://www.contextures.com:80/xlvba01.html

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Sheri" wrote in message
...
I am close, but no cigar. I have a formula in cell A1 that is
=TestSheet!A1,
in B1 I have the following formula - =MID(CELL("filename",A1), FIND("]",
CELL("filename", A1))+ 1, 255), which results in it saying Sheet1. What I
need is for the formula in cell B1 to tell me which sheet A1 is coming
from.
So ideally in B1, it would say TestSheet. Any suggestions?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Tab Name Reference

Bernard, thank you. I am not that savvy with UDFs, how do I get it to work?

"Bernard Liengme" wrote:

Here is a UDF that does that

Function getname(mycell)
myform = mycell.Formula
x = InStr(1, myform, "!")
getname = Mid(myform, 2, x - 2)
End Function


David McRitchie's site on "getting started" with VBA

http://www.mvps.org/dmcritchie/excel/getstarted.htm

Debra Dalgleish's "Adding Code to a Workbook"

http://www.contextures.com:80/xlvba01.html

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Sheri" wrote in message
...
I am close, but no cigar. I have a formula in cell A1 that is
=TestSheet!A1,
in B1 I have the following formula - =MID(CELL("filename",A1), FIND("]",
CELL("filename", A1))+ 1, 255), which results in it saying Sheet1. What I
need is for the formula in cell B1 to tell me which sheet A1 is coming
from.
So ideally in B1, it would say TestSheet. Any suggestions?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,104
Default Tab Name Reference

Follow the links in my message
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Sheri" wrote in message
...
Bernard, thank you. I am not that savvy with UDFs, how do I get it to
work?

"Bernard Liengme" wrote:

Here is a UDF that does that

Function getname(mycell)
myform = mycell.Formula
x = InStr(1, myform, "!")
getname = Mid(myform, 2, x - 2)
End Function


David McRitchie's site on "getting started" with VBA

http://www.mvps.org/dmcritchie/excel/getstarted.htm

Debra Dalgleish's "Adding Code to a Workbook"

http://www.contextures.com:80/xlvba01.html

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Sheri" wrote in message
...
I am close, but no cigar. I have a formula in cell A1 that is
=TestSheet!A1,
in B1 I have the following formula - =MID(CELL("filename",A1),
FIND("]",
CELL("filename", A1))+ 1, 255), which results in it saying Sheet1.
What I
need is for the formula in cell B1 to tell me which sheet A1 is coming
from.
So ideally in B1, it would say TestSheet. Any suggestions?






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Tab Name Reference

Bernard, thank you, it is working beautifully!

"Bernard Liengme" wrote:

Follow the links in my message
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Sheri" wrote in message
...
Bernard, thank you. I am not that savvy with UDFs, how do I get it to
work?

"Bernard Liengme" wrote:

Here is a UDF that does that

Function getname(mycell)
myform = mycell.Formula
x = InStr(1, myform, "!")
getname = Mid(myform, 2, x - 2)
End Function


David McRitchie's site on "getting started" with VBA

http://www.mvps.org/dmcritchie/excel/getstarted.htm

Debra Dalgleish's "Adding Code to a Workbook"

http://www.contextures.com:80/xlvba01.html

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Sheri" wrote in message
...
I am close, but no cigar. I have a formula in cell A1 that is
=TestSheet!A1,
in B1 I have the following formula - =MID(CELL("filename",A1),
FIND("]",
CELL("filename", A1))+ 1, 255), which results in it saying Sheet1.
What I
need is for the formula in cell B1 to tell me which sheet A1 is coming
from.
So ideally in B1, it would say TestSheet. Any suggestions?








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,104
Default Tab Name Reference

Well done!
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Sheri" wrote in message
...
Bernard, thank you, it is working beautifully!

"Bernard Liengme" wrote:

Follow the links in my message
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Sheri" wrote in message
...
Bernard, thank you. I am not that savvy with UDFs, how do I get it to
work?

"Bernard Liengme" wrote:

Here is a UDF that does that

Function getname(mycell)
myform = mycell.Formula
x = InStr(1, myform, "!")
getname = Mid(myform, 2, x - 2)
End Function


David McRitchie's site on "getting started" with VBA

http://www.mvps.org/dmcritchie/excel/getstarted.htm

Debra Dalgleish's "Adding Code to a Workbook"

http://www.contextures.com:80/xlvba01.html

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Sheri" wrote in message
...
I am close, but no cigar. I have a formula in cell A1 that is
=TestSheet!A1,
in B1 I have the following formula - =MID(CELL("filename",A1),
FIND("]",
CELL("filename", A1))+ 1, 255), which results in it saying Sheet1.
What I
need is for the formula in cell B1 to tell me which sheet A1 is
coming
from.
So ideally in B1, it would say TestSheet. Any suggestions?








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
Changing sheet reference to cell reference TeeJay Excel Worksheet Functions 3 October 19th 07 11:50 AM
Column letter reference as number reference mcphc Excel Programming 8 January 30th 07 03:06 PM
Formulas that reference cells that reference another cell Andrea Excel Discussion (Misc queries) 7 October 19th 06 08:14 AM
Row reference increment but preserve column reference Pwanda Excel Worksheet Functions 1 April 28th 05 01:12 PM
Macro to Reference Column Next to Current Reference dolphinv4 Excel Discussion (Misc queries) 2 April 11th 05 08:36 AM


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