View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
DM Unseen DM Unseen is offline
external usenet poster
 
Posts: 233
Default How do you add 1 to an invoice number in Excel. Formula for th

Susan,

it's Dutch, not German;) (go, cloggies go;). I made this code for a
dutch excel newsgroup poster.

What you want needs VBA. VBA is Excel's macro language, although it is
in fact a full programming language. (Excel has another macro language,
one looking more like lotus, called XLM, but official support has
dropped from version 5 onwards) . If you want to be as good on Excel as
on Lotus, there is no way around VBA!

My code works more or less the same as Bob's & Greg's.
Just replace the reference "M3" from the code from:
**With Me.Worksheets(1).Range("M3") **
with the correct cell with the invoice number. You could also use
define-name and use that name instead.
Also do not forget to add the custom document property.

The *difference* lies in the invoice file management. the dutch poster
requested that once the invoice number on the file has been created you
want to save the file under another name for later use, and not have
the number increase *again* when you later open that invoice again.
This means that each invoice can have it's own workbook, but still all
workbooks should contain a unique number! As far as I understand Bob's
code will update the invoice number *each time* you open a file which
has that code in it. So there is just one workbook that each time you
open it becomes a new invoice(since the numer is increased). This is
more like your request, so you pick your solution and just request
additional help with installing the VBA on your file.

DM Unseen