View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Want Cell A1 equal to File name + Worksheet name

If you are looking for a macro try this. Launch VBE using Alt + F11. From the
left tree view double click 'This Workbook' and paste the below code. Get
back to workbook. The below code will write the bookname and sheet name to
cell A1 on Save....

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Range("A1") = "[" & ThisWorkbook.Name & "]" & ThisWorkbook.ActiveSheet.Name
End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"Lawrence" wrote:

Hi,

i want the cell A1 equal to File name + Worksheet name.. is it possible?

Lawrence