| Start |
|---|
| Organizing new invoice numbers Incrementing an invoice number and saving its value is a frequent task. Using CustomDocumentProperties (CDPs) is a good method to store such numbers in a relatively safe way within the same work book, but avoiding to show related cell values simply in an unprotected work sheet. Additional hint: Alternatively, you could enter values also in a hidden worksheet or even a so called "very hidden" worksheet (see Using xlVeryHidden Sheets (opens new window)). Of course, it's possible to save data also to external files (e.g. ini file, csv or any other type) or the registry. Example content: The example below shows
You can get and set the next invoice number (last no plus one) simply by calling the above mentioned function, returning a string value in order to facilitate adding prefixes. "InvoiceNo" is implicitly used as CDP name in all procedures. Example code: End Sub |
Read Article
https://develop.horje.com/learn/1434/reference