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

  • Thread starter Thread starter SLD
  • Start date Start date
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

http://www.mvps.org/dmcritchie/excel/getstarted.htm

Debra Dalgleish's "Adding Code to a Workbook"

http://www.contextures.com:80/xlvba01.html

best wishes
 
Back
Top