View Single Post
 
Old 04-28-2017, 04:48 PM
Logit Logit is offline Windows 10 Office 2007
Expert
 
Join Date: Jan 2017
Posts: 591
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

Here is the basics of what you are requiring, assuming your Invoice Template is part of the Sheet and not a Form.

Create a Routine Module and paste this code into the module :

Code:
Option Explicit
Sub PlsOne()
Dim num As Integer
    Range("A1").Select
    num = Range("A1").Value
    num = num + 1
    Range("A1").Value = num
End Sub
In ThisWorkBook module, paste this code :

Code:
Option Explicit

Private Sub Workbook_Open()
    PlsOne
End Sub
Each time you open the workbook, the number in A1 of Sheet 1 will increment by one
number.

You can edit the code to have this applied to any sheet and/or any cell.
Attached Files
File Type: xlsm Increment Number.xlsm (16.3 KB, 17 views)
Reply With Quote