ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   increasing invoice number automatically (https://www.excelbanter.com/excel-worksheet-functions/123046-increasing-invoice-number-automatically.html)

Froggy68

increasing invoice number automatically
 
I am trying to make an invoice that will automatically increase the Invoice
number automatically everytime I open the file and is there a way to have the
currant date update everytime the invoice file is opened to make a new
invoice. Is this possible? and if so How?

Niek Otten

increasing invoice number automatically
 
http://www.mcgimpsey.com/excel/udfs/sequentialnums.html


--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Froggy68" wrote in message ...
| I am trying to make an invoice that will automatically increase the Invoice
| number automatically everytime I open the file and is there a way to have the
| currant date update everytime the invoice file is opened to make a new
| invoice. Is this possible? and if so How?



Paul B

increasing invoice number automatically
 
Froggy68, have a look here,

http://www.mcgimpsey.com/excel/udfs/sequentialnums.html

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"Froggy68" wrote in message
...
I am trying to make an invoice that will automatically increase the

Invoice
number automatically everytime I open the file and is there a way to have

the
currant date update everytime the invoice file is opened to make a new
invoice. Is this possible? and if so How?




Froggy68

increasing invoice number automatically
 
Thank you Paul, i did find that link while reading thru other messages to
find an answer. I tried inserting the code but will not work for me. I'll try
to figure it out and let you know what i did wrong, maybe it will help
someone else too.

"Paul B" wrote:

Froggy68, have a look here,

http://www.mcgimpsey.com/excel/udfs/sequentialnums.html

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"Froggy68" wrote in message
...
I am trying to make an invoice that will automatically increase the

Invoice
number automatically everytime I open the file and is there a way to have

the
currant date update everytime the invoice file is opened to make a new
invoice. Is this possible? and if so How?





Froggy68

increasing invoice number automatically
 
Thank you Niek, i did find that link while reading thru other messages to
find an answer. I tried inserting the code but will not work for me. I'll try
to figure it out and let you know what i did wrong, maybe it will help
someone else too.

"Niek Otten" wrote:

http://www.mcgimpsey.com/excel/udfs/sequentialnums.html


--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Froggy68" wrote in message ...
| I am trying to make an invoice that will automatically increase the Invoice
| number automatically everytime I open the file and is there a way to have the
| currant date update everytime the invoice file is opened to make a new
| invoice. Is this possible? and if so How?




Ivyleaf

increasing invoice number automatically
 


On Dec 19, 9:24 am, Froggy68
wrote:
I am trying to make an invoice that will automatically increase the Invoice
number automatically everytime I open the file and is there a way to have the
currant date update everytime the invoice file is opened to make a new
invoice. Is this possible? and if so How?


Hi Froggy68,

I would suggest using a custom document property rather than an
external file or the registry... this way the property stays with the
file regardless.

For example:

Private Sub Workbook_Open()
Dim InvoiceNum As Integer
On Error Resume Next
Err.Clear
InvoiceNum = CustomDocumentProperties("Invoice").Value
If Err.Number < 0 Then ThisWorkbook.CustomDocumentProperties.Add
Name:="Invoice", LinkToContent:=False, Type:=msoPropertyTypeNumber,
Value:=1
ThisWorkbook.CustomDocumentProperties("Invoice").V alue = (InvoiceNum +
1)
Application.Calculate
End Sub

Placed in the workbook, then:

Private Function GetProperty(Info_needed As String) As Variant
Application.Volatile
GetProperty =
ThisWorkbook.CustomDocumentProperties(Info_needed) .Value
End Function

Placed in a module. After this is in place, the invoice number can be
called anywhere in the sheet by entering '=GetProperty("Invoice")' in
any cell.

Another variation of this would be to store the value in a cell instead
of a property value, but then it could be deleted more easily.

Cheers,
Ivan.



All times are GMT +1. The time now is 08:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com