Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to make a cell value increment every time a new worksheet is o

Kindly help as I need to make Invoice and need the invoice number to
increment every time I use a new invoice. Thanks and regards.
Bari
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 471
Default how to make a cell value increment every time a new worksheet is o

If you are in a multi-user environment, the way to do it is to use either a
text file or an access db to store information like this. Then you can
increment and store in that file and then read into a variable in excel.
That is how I do it. If just a single-user environment, put the number on a
hidden sheet and then unhide, read, increment and then use the number. Good
luck.

Here is code for a text file:

Sub incrementInvoiceNbr()
Dim FName As String
FName = "C:\temp\invoice.no"
FF = FreeFile()
Open FName For Input As #FF
Line Input #FF, L
MsgBox (L)

Close #FF
Kill "c:\temp\invoice.no"
FF = FreeFile()
Open "C:\TEMP\INVOICE.NO" For Output As #FF
Write #FF, Val(L) + 1

Close #FF


End Sub



"mabari" wrote:

Kindly help as I need to make Invoice and need the invoice number to
increment every time I use a new invoice. Thanks and regards.
Bari

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
How to increment page number in a cell of worksheet Zubair Excel Discussion (Misc queries) 2 February 5th 10 01:46 PM
copy cell with macro and increment down each time RJJ Excel Worksheet Functions 6 May 9th 08 06:16 PM
how to make excel auto enter increment invoice numbers. foster1929 Excel Discussion (Misc queries) 1 July 11th 06 03:05 AM
how to auto increment a number each time i open the worksheet fred rondak Excel Worksheet Functions 1 June 25th 05 11:40 PM
how to make cell address reference increment? jacko Excel Worksheet Functions 3 June 1st 05 05:33 PM


All times are GMT +1. The time now is 09:59 PM.

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

About Us

"It's about Microsoft Excel"