View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
bestofcomputer bestofcomputer is offline
external usenet poster
 
Posts: 3
Default How to program an auto incrementable number in a cell, at each

I am using Excel 2000 SP3.
And I have never used VBA, or even Macros...
I am ashamed, and very sorry...
So, your programming suggestions were very good, thanks a lot, but I am
unable to program these...
So, could you give me some details about how to do that ?
I would like also to send you my calc, dear Rock, but could you give me your
email ?
Or, I can give you mine, so that you can contact me, and I will forward you
my calc, so that you can include the codes, and mail it back to me.
My email : contact at bestofcomputers . com
Thanks.

"Rock" wrote:


bestofcomputer Wrote:
So, now, is it possible to program that cell, to automatically generate
a
bill number in the same format as we already use, but not randomly, and
using
numbers following each others, incrementally, increasing of 1 unit,
from
previous bill, to the new bill ?


I don't know how do you "generate" a new bill? By each of the times
that the file is opened? Or by clicking the sheet?

If yes, I am sure that there shuold be easier way to do.

However, I do not recommend this way of generating a new bill because
it is easy to make a mistake that some one may "open" or "click"
without intention to make a new bill.

I think you can write a small VBA code in Sheet1 (called "NewBill"),
and create a button to assign this macro. The second macro called
"Delete1bill", and create a button to assign this macro. In column A of
sheet2, you store the sequence number of the Bills that created.

The "NewBill" have 3 simple tasks:
1- Look at the final cell of column A in sheet2, add 1 unit, then write
this value to the place of the new bill.
2- Delete all the "written" content of the previous bill to create a
new blank bill.
3- Write the number of this new bill to the last cell of column A in
sheet2

The "Delete1bill" have 1 simple tasks:
1- Delete the last cell in column A in sheet2.
This macro will hepl you to delete a bill that by mistake, the
"NewBill" button is clicked.

These are simple macro so I hope you can write these yourself. If not,
just tell so that we can help you.


--
Rock


------------------------------------------------------------------------
Rock's Profile: http://www.excelforum.com/member.php...o&userid=29723
View this thread: http://www.excelforum.com/showthread...hreadid=498985