Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Vbscript code to auto increment by 1 text value '0000001'

Status
Not open for further replies.

kdjonesmtb2

Technical User
Nov 19, 2012
93
US
What is the correct vbscript to auto increment a starting txt value of '0000001 by 1

For example

0000001
0000002
0000003

etc

Thanks
 
Here's one way:

Code:
[blue]Public Function AutoInc(strSource)
    AutoInc = Right(String(6, "0") & strSource + 1, 7)
End Function[/blue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top