BeforeSave event

C

Carl Bowman

I am trying to build a macro that will automatically clear the contents of a
certain cell just before the workbook is saved. I tried entering is as
follows but it did not work:
Sub Workbook_BeforeSave()
Sheets("Instructions").Select
Range("E5").Select
Selection.ClearContents
End Sub
Thanks
 
R

R D S

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Sheets("Instructions").Select
Range("E5").Select
Selection.ClearContents

End Sub
 
K

Ken Wright

In the ThisWorkbook module

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Sheets("Instructions").Range("E5").ClearContents
End Sub
 
Top