Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 04-28-2017, 04:48 PM
Logit Logit is offline number for invoices and forms automatically increasing by 1 each time I open the template Windows 10 number for invoices and forms automatically increasing by 1 each time I open the template 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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ms Word Template with VBA forms not working in SharePoint KangarooJack Word VBA 0 01-28-2016 02:11 PM
number for invoices and forms automatically increasing by 1 each time I open the template Time Stamps automatically changed to same time! hydrogyny Word 4 02-09-2015 08:57 PM
I want Word to open a normal blank template upon launch, not ask me every time! rganzen1 Word 2 11-17-2013 05:42 PM
Labeling sequential forms with a unique number krau0231 Word 1 10-18-2012 03:33 PM
Add increasing number at document opening HidExp Word 6 09-17-2012 12:28 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:32 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft