Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Auto invoice numbering

I need a auto invoice numbering on a new worksheet that can add a
consequence invoice number from the previous worksheet number.

Any help is greatly appreciated.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Auto invoice numbering

Hi
do you really mean 'worksheet' and not 'workbook'. For the latter one
you may have a look at the following repost. It assumes you have a
invoice template (*.xlt file)

----------------
one way (using the Windows registry for storing the last number). Put
the following code in the workbook module (not in a standard module) of
your template:
- It changes cell A1 of the first sheet
- you may change the key identifiert according to your needs (e.g.
DEFAULTSTART, MYLOCATION, etc.)

Private Sub Workbook_Open()
Const DEFAULTSTART As Integer = 1
Const MYAPPLICATION As String = "Excel"
Const MYSECTION As String = "myInvoice"
Const MYKEY As String = "myInvoiceKey"
Const MYLOCATION As String = "A1"
Dim regValue As Long

With ThisWorkbook.Sheets(1).Range(MYLOCATION)
If .Text < "" Then Exit Sub
regValue = GetSetting(MYAPPLICATION, MYSECTION, _
MYKEY, DEFAULTSTART)
.Value = CStr(regValue)
SaveSetting MYAPPLICATION, MYSECTION, MYKEY, regValue + 1
End With
End Sub

--
Regards
Frank Kabel
Frankfurt, Germany

"unkown" schrieb im Newsbeitrag
news:niscc.35943$Ig.27302@pd7tw2no...
I need a auto invoice numbering on a new worksheet that can add a
consequence invoice number from the previous worksheet number.

Any help is greatly appreciated.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Auto invoice numbering

Using the registry means that the workbook can be used only on the PC whose registry holds the invoice number counter.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default Auto invoice numbering

Not very elegant, but easy to set up:

* what you need!
1 excel WB called "Invoice.xls" in which there are 2 sheets, "Invoice"
and "Data"

Concept:
You store a number in the data page which is updated when somthing
happens:

code bit one:
sheets("data").cells(1,1).value = sheets("data").cells(1,1).value +1

code bit 2
sheets("Invoice").Range("a2").value = sheets("data").cells(1,1).value

so this puts the number in a2 on the invoice sheet, which you format
as you like;

now where do you put these code?

well you can put code 2 in the open workbook event, and the code one
bit in the
before close, and you get a book that opens with a new invoice number
and updates it on each open/close,
Better, to put the 2 codes buttons on the Invocie sheet, and then you
can make as many invoice as you like, with out opening closing

so you get this

Private Sub CommandButton1_Click()
Sheets("data").Cells(1, 1).Value = Sheets("data").Cells(1, 1).Value +
1
Sheets("Invoice").Range("a2").Value = Sheets("data").Cells(1, 1).Value
End Sub

ross





"unkown" wrote in message news:<niscc.35943$Ig.27302@pd7tw2no...
I need a auto invoice numbering on a new worksheet that can add a
consequence invoice number from the previous worksheet number.

Any help is greatly appreciated.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Invoice numbering dave Excel Discussion (Misc queries) 1 September 5th 07 05:19 AM
execute auto invoice numbering in excel file tom adeimy Excel Discussion (Misc queries) 1 July 25th 06 02:54 AM
is there an auto-numbering tax invoice templete for excel stepping Excel Discussion (Misc queries) 1 May 27th 06 11:24 AM
Is auto invoice numbering possible in Excel 2003? JODYG35950 Excel Discussion (Misc queries) 1 February 25th 06 06:40 PM
Very specific invoice auto numbering for the gurus VanAlex Excel Programming 1 November 24th 03 07:49 PM


All times are GMT +1. The time now is 04:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"