How to get the SheetName from =SheetName!A1

Ceeyee

Board Regular
Joined
Feb 2, 2011
Messages
164
HI,

In Cell D1 I have a formula =AAA!A1
AAA is a Sheet Name of another sheet

How to use a formula referencing this cell D1 to return AAA?
i.e Formula(D1) returns AAA

Thanks.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
TRY THIS FORMULA

=MID(CELL("filename",AAA!A1),SEARCH("]",CELL("filename",AAA!A1),1)+1,LEN(CELL("filename",AAA!A1)))
 
Upvote 0
you will need to use this formula in the same sheet whose name you want to extract

=MID(CELL("filename"),SEARCH("]",CELL("filename"),1)+1,LEN(CELL("filename")))
 
Upvote 0
Here is also a function, works for me :)

cheers

Code:
Function trimformula(targetCell As Range)

Dim X  As String
Dim Y  As String
Dim A As Integer
Dim B As Variant

   X = InStr(1, targetCell.FormulaLocal, "(", vbTextCompare)
   Y = InStr(1, targetCell.FormulaLocal, "!", vbTextCompare)
   
   A = (Y - X)
   B = Mid(targetCell.FormulaLocal, X + 1, A - 1)
   
   trimformula = B
   
End Function
 
Upvote 0
HI,

In Cell D1 I have a formula =AAA!A1
AAA is a Sheet Name of another sheet

Am I out of date here or from what I understand =AAA!A1 is not Excel conventional sheet naming within a formula nor is it a formula?
Anyway you can edit the Function above just replace the "(" with an "=".
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,278
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top