increment version number

L

Lozza77

Is there anyway to automatically increment a number in a spreadsheet
everytime the document is saved? ie version number?
 
A

Ardus Petus

Paste following code in Workbook's code:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
With Me.Worksheets("Sheet1").Range("A1")
.Value = .Value + 1
End With
End Sub

HTH
 
L

Lozza77

Thanks Ardus.

How do you edit the workbooks code or do you mean paste it into a cell?
Sorry - I'm a novice!

Regards,
Louren.
 
A

Ardus Petus

Right-click on the Excel icon on top left of your worksheet,
then select Code.
Paste the code in the newly opened window.
Get back to Excel (vlick on Excel icon)

Save your workbook: the version number will go up by 1

HTH
 
Top