You could also use the MID function instead of REPLACE

example

=MID(CELL("filename"),FIND("]",CELL("filename"))+1,31)

Note that the second formula in my previous post requires enabling your
macro settings. So I am not sure how much that is helpful in the end
(assuming the reason you wanted to do it using formula was to avoid having
to do anything to do with macro in the first place)

Regards,
Sam


On Wed, Mar 27, 2013 at 9:44 PM, Sam Mathai Chacko <samde...@gmail.com>wrote:

> I would agree with Paul. The best thing to do is to write a function like
> this
>
> Function PREVSHEETNAME() As String
>
>     On Error Resume Next
>     PREVSHEETNAME = ActiveSheet.Previous.Name
>     Application.Volatile
>
> End Function
>
> On the contrary, if you are still intent on doing this with formula, you
> could try a rather unconventional method using XLM formulas
>
> Create two named ranges as below
>
> SheetName =REPLACE(CELL("filename"),1,FIND("]",CELL("filename")),"")
>
> SheetNames = REPLACE(GET.WORKBOOK(1),1,FIND("]",GET.WORKBOOK(1)),"")
>
> And in your sheet (starting from the second sheet of course), use the
> formula =INDEX(SheetNames,MATCH(SheetName,SheetNames,0)-1)
>
> Regards,
>
> Sam Mathai Chacko
>
>
> On Wed, Mar 27, 2013 at 7:01 PM, Paul Schreiner <schreiner_p...@att.net>wrote:
>
>>  How do you define "Previous Sheet Name"?
>> Do you mean the name of the sheet before it was changed to the current
>> name?
>> or do you mean the name of the sheet immediately to the left of the
>> selected sheet?
>>
>> Also, you said "using formula", does that mean you wish for an excel
>> function that will show (in a cell) whatever it is you refer to as
>> "Previous Sheet Name"?
>>
>> If you're wanting the name of the sheet immediately to the left,
>> I doubt very much that we can do it using "standard" Excel functions.
>> We can create a function that looks in the Sheets() array for the current
>> sheet name,
>> then determines the name of the sheet with the "previous" array index...
>>
>>
>>
>> *Paul*
>>
>> -----------------------------------------
>> *“Do all the good you can,
>> By all the means you can,
>> In all the ways you can,
>> In all the places you can,
>> At all the times you can,
>> To all the people you can,
>> As long as ever you can.” - John Wesley
>> *-----------------------------------------
>>
>>
>>  ------------------------------
>> *From:* Sundarvelan N <nsund...@gmail.com>
>> *To:* excel-macros@googlegroups.com
>> *Sent:* Wed, March 27, 2013 9:12:14 AM
>> *Subject:* $$Excel-Macros$$ Previous sheet name using formula
>>
>> Dear Friends,
>>
>> Please help me to get the previous sheet name using formula
>>  Thanks
>> N.Sundarvelan
>> 9600160150
>>
>> --
>> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
>> =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
>> https://www.facebook.com/discussexcel
>>
>> FORUM RULES
>>
>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
>> will not get quick attention or may not be answered.
>> 2) Don't post a question in the thread of another member.
>> 3) Don't post questions regarding breaking or bypassing any security
>> measure.
>> 4) Acknowledge the responses you receive, good or bad.
>> 5) Jobs posting is not allowed.
>> 6) Sharing copyrighted material and their links is not allowed.
>>
>> NOTE : Don't ever post confidential data in a workbook. Forum owners and
>> members are not responsible for any loss.
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "MS EXCEL AND VBA MACROS" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to excel-macros+unsubscr...@googlegroups.com.
>> To post to this group, send email to excel-macros@googlegroups.com.
>> Visit this group at http://groups.google.com/group/excel-macros?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>> --
>> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
>> =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
>> https://www.facebook.com/discussexcel
>>
>> FORUM RULES
>>
>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
>> will not get quick attention or may not be answered.
>> 2) Don't post a question in the thread of another member.
>> 3) Don't post questions regarding breaking or bypassing any security
>> measure.
>> 4) Acknowledge the responses you receive, good or bad.
>> 5) Jobs posting is not allowed.
>> 6) Sharing copyrighted material and their links is not allowed.
>>
>> NOTE : Don't ever post confidential data in a workbook. Forum owners and
>> members are not responsible for any loss.
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "MS EXCEL AND VBA MACROS" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to excel-macros+unsubscr...@googlegroups.com.
>> To post to this group, send email to excel-macros@googlegroups.com.
>> Visit this group at http://groups.google.com/group/excel-macros?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
>
> --
> Sam Mathai Chacko
>



-- 
Sam Mathai Chacko

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to