Use tiltle in a cell

Μ

µ

Is there a way to use the title of the spreadsheet as a cell value?
I asked this before in another topic, but there was no reply.

My sheet get's it's title from a database and is variable.
So if i can use the title i can strip several characters from the
title and use this.

So I want to retrieve the title of the spreadsheet and use this in a
cell.

Thanks!
 
B

Bernard Liengme

The name of a worksheet can be extracted to a cell with:
=MID(CELL("Filename",A1),FIND("]",CELL("Filename",A1))+1,255)
best wishes
 
J

JE McGimpsey

If you're talking about the worksheet name, see

http://www.mcgimpsey.com/excel/formulae/cell_function.html

If you're talking about the Workbook document property "Title", then
this UDF would work:

Public Function GetTitle(Optional ByVal rng As Range) As String
Dim wb As Workbook
If Not rng Is Nothing Then
Set wb = rng.Parent.Parent
Else
Set wb = Application.Caller.Parent.Parent
End If
GetTitle = CStr(wb.BuiltinDocumentProperties("Title"))
End Function
 
Μ

µ

Thanks all of you!!
Because I'm using the Dutch version of Excel this formula looks looks
this:

=DEEL(CEL("filename");VIND.ALLES("[";CEL("filename"))+1;VIND.ALLES("]";CEL("filename"))-VIND.ALLES("[";CEL("filename"))-1)


Thanks for getting me started!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top