Daily tips for using Microsoft Excel.

Saturday, May 25, 2002

Roger asks “We are racking our brains here trying to design a form in Excel that
automatically increments the number (i.e. 5600) by one each time the form is
opened. Is there a formula or macro that will accomplish this task?”


In the Workbook module (Or, if it’s a Userform, in the Initialize event of that Userform) put the following:

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