View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Office User Office User is offline
external usenet poster
 
Posts: 18
Default How do I set up incremental numbering of Invoices in Excel?

I don't know where my brain lapse is happening but I'm struggling trying to
figure out this code. I'm utilizing the one to have text file store the
numbers.

My InvoiceNumber.txt file is located on c:\. The file is blank except for
the number 100. Here's part of your code with my file location and name.

Public Function NextSeqNumber(Optional sFileName As String, Optional
nSeqNumber As Long = -1) As Long
Const sDEFAULT_PATH As String = "c:\"
Const sDEFAULT_FNAME As String = "InvoiceNumber.txt"
Dim nFileNumber As Long

When I open the template file, I don't get any error message but it doesn't
update the cell with a number. Currently cell L4 is blank.

Public Sub Workbook_Open()
ThisWorkbook.Sheets(1).Range("L4").Value = NextSeqNumber
End Sub

Both the Function and Sub are saved in This.Workbook.

I'm sure it's an obvious oversight on my part but any help would be greatly
appreciated.

Thanks,
Marcia


"JE McGimpsey" wrote:

A couple of ways:

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



In article ,
TFT wrote:

I am trying to create a procedure within Excel which will allow me to
automatically bring up a sequentially numbered invoice for my small business.
Designing invoices is not a problem but trying to automate them so that they
appear with a follow up number is eluding me.