Determine if a workboo has been saved

  • Thread starter Thread starter QuietMan
  • Start date Start date
Q

QuietMan

I trying to have a macro auto exceute to put the user name in a cell on a
worksheet each time the workbook is saved

Does anyone know how to do this?
 
Hi,

Alt+F11 to open VB editor. Double click 'this workbook' and paste this in on
the right

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Sheets("Sheet1").Range("a1").Value = Environ("Username")
End Sub

Mike
 
Your description does not match your subject line but maybe........

Private Sub Workbook_BeforeSave(ByVal SaveAsUI _
As Boolean, Cancel As Boolean)
Sheets("Sheet1").Range("A1").Value = "Last Saved By " & Environ("UserName")
End Sub


Gord Dibben MS Excel MVP
 

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