workbook name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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)
 

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

Back
Top