MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Worksheet names to cell

Posted by Ian G on August 01, 2001 9:43 PM

How do I insert a worksheet name into a cell?

Posted by Alix on August 02, 2001 6:12 AM

Hi Ian

The code below will insert the workbook name into a cell

Sub NameCell()
ActiveCell.Value = ActiveWorkbook.Name
End Sub

The following code will enter both the file path and name of the file into the cell

Sub FullNameCell()
ActiveCell.Value = ActiveWorkbook.FullName
End Sub



Posted by Ian G on August 02, 2001 4:08 PM