Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting the file name in a cell 1

Status
Not open for further replies.

GRoStruc

Marine/Ocean
Joined
Oct 11, 2006
Messages
23
Hi,

Probably a stupid question but...

Is there a command for inserting the file name into a cell within a workbook, in the same vein as inserting it into the header, &[FILE]?

Thanks,

GRo
 
Simple macro should do it:
Code:
Private Sub Workbook_Open()
Cells(1, 1) = ActiveWorkbook.Path & "\" & ActiveWorkbook.Name
End Sub

Good Luck
johnwm
________________________________________________________
To get the best from these forums read faq731-376 before posting
Steam Engine enthusiasts
Steam Engine Prints
 
=CELL("filename",A1)

Cheers,
Joerd

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top