Auto form number

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.
 
B

bertieBassett

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top