putting file name within spreadsheet

  • Thread starter Thread starter bobf
  • Start date Start date
B

bobf

Is there any way I can display the name of my Excel
spreadsheet in cell A1 of the spreadsheet?
 
=CELL("filename",A1)

look in help at =Cell and =Info
for other uses

HTH
RES
 
....Type it in?

Yes, but afaik it can only be done with some VBA code.
1. Open the VBA editor
2. Along the left margin choose the VBAProject associated with your
file
3. Right click "This workbook" and select "View Code". A new VBA
editor window opens. Dropdowns along the top should say "This
workbook" and "Open". The structure for a new routine is visible:
"Private Sub Workbook_Open()" and "End Sub".
4. Use this code:
Range("a1").value = activeworkbook.name

Each time you open the file this routine will run. If your workbook
has multiple tabs you'll need to specify which tab to write in: try
this line of code:

Sheets("YourSheetName").select

Final code looks like:
Private Sub Workbook_Open()
Sheets("YourSheetName").Select
Range("a1").Value = ActiveWorkbook.Name
End Sub
 
bobf said:
Is there any way I can display the name of my Excel
spreadsheet in cell A1 of the spreadsheet?

try: -

=MID(CELL("filename",C9538),FIND("[",CELL("filename",C9538))+1,FIND("]",CELL("filename",C9538))-FIND("[",CELL("filename",C9538))-1)
 

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

Similar Threads


Back
Top