Excel - How to increase a number by 1 every time the spreadsheet opens?

Asked By SLD on 15-Sep-09 03:11 PM
Is there a way to have a number increase by 1 every time the excel
spreadsheet opens?

Bernard Liengme replied on 15-Sep-09 03:30 PM
With a Workbook open even macro such as

Private Sub Workbook_Open()
Range("Sheet1!A1").Value = Range("Sheet1!A1").Value + 1
End Sub

Open the VBA editor, right click ThisWorkbook for the file in question and
use View Code
Paste this macro into the module

New to VBA? See

David McRitchie's site on "getting started" with VBA


Debra Dalgleish's  "Adding Code to a Workbook"


best wishes
Bernard V Liengme
Microsoft Excel MVP
remove caps from email