workbook name

T

Tuukka

Hi,
is it possible to automatically name workbooks so that it gets its name from
ie. shell A1? Workbook is saved to prevent unwanted actions but still users
would need to name each workbook.
 
B

Bob Phillips

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If SaveAsUI Then
Cancel = True
ThisWorkbook.SaveAs = Worksheets("Sheet1").Range("A1").Value
End If
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)
 
Top