Auto form number

  • Thread starter Thread starter Freshman
  • Start date Start date
F

Freshman

Dear experts,

I want to create a form template with a form number. This
number should be unique and never reuse again. For
example, the starting number is 0001, then I want the
number will be changed automatically to 0002 and so forth
when the form of 0001 is printed. What is the formula for
this number automation? Please kindly advise.

Many thanks.
 
you need to set up a macro so that when you print the sheet, it will
automattically update the cell that you have defined for your `unique
number`


Sheets("worksheet").Select ' SELECT SHEET

a = Workbooks("filename.xls").Worksheets("worksheet").Range("a1").Value
' DEFINE VALUE OF A - FROM CELL IN WORKSHEET

ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True ' PRINT
SHEET

a=a+1 ' UPDATES UNIQUE NUMBER

Worksheets("worksheet").Range("a1").Value = a ' UPDATES UNIQUE NUMBER
ON SHEET
 
Back
Top