# Cell reference to a worksheet.

#### gibbsak

##### New Member
Is there a formula to link a cell to return the label of a particular worksheet?

I have several worksheets and each has a title. I would like the titles to be filled automatically based on the worksheet name found in the tabs at the bottom.

Thanks

### Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

#### VoG

##### Legend
Try

<code>=RIGHT(CELL("filename",A1),LEN(CELL("filename",A1))-FIND("]",CELL("filename",A1)))

the file must be saved for this to work.
</code>

#### Darren Bartrup

##### Well-known Member
Something like:

Code:
``=RIGHT(CELL("filename",Sheet5!\$N\$1),LEN(CELL("filename",Sheet5!\$N\$1))-FIND("]",CELL("filename",Sheet5!\$N\$1)))``

The function CELL returns specific information about the referenced cell.

The argument "filename" returns the full path, including the sheet name of a referenced cell within a saved workbook.

The key here is that the workbook name is enclosed in square brackets [ ], and anything that appears after the closing bracket is the sheet name, so the formula finds the closing bracket (]) and returns anything to the right of it.

#### gibbsak

##### New Member
Try

<CODE>=RIGHT(CELL("filename",A1),LEN(CELL("filename",A1))-FIND("]",CELL("filename",A1)))

the file must be saved for this to work.
</CODE>

Thank You

That worked great.

#### snb_

##### Well-known Member
UDF:

Code:
``````Function sheetname()
sheetname = ActiveSheet.Name
End Function``````
in B5:
=sheetname()

or

=Mid(CELL("filename");FIND("]";CELL("filename"))+1;200)

Replies
2
Views
82
Replies
7
Views
110
Replies
17
Views
271
Replies
19
Views
679
Replies
13
Views
227

1,127,554
Messages
5,625,474
Members
416,109
Latest member
TripleA00123

### 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.

### Which adblocker are you using?

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

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