auto update of date and time whenever changes are made to a xcel s

  • Thread starter Thread starter saran
  • Start date Start date
S

saran

Hi..
In the case of using auto update program for date and time thro vba editor,
the following error occurs
run time error 9.
This problem is more predominant in excel having more than one sheet.
Can u pl suggest what may b the problem.
 
Try this code. Put this code in the ThisWorkbook object.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Sheets("Sheet1").Range("A1").Value = " " & Now
End Sub
 

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