Incrementing a receipt number in Excel 2003 VB form

T

Tom

Hi,

Can any one tell me how to do the simple task of having a
receipt number increment automatically in VB code? I
thought that it was as easy as something like:

ReceiptNo = ReceiptNo + 1


Where ReceiptNo is the name of the range where the number
is to appear. However this does not seem to work!

Help would be appreciated.

Tom
 
C

Chip Pearson

Tom,

If ReceiptNo is a named range, use code like

Range("ReceiptNo").Value = Range("ReceiptNo").Value + 1


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
T

Tom

Chip,

Thank you very much, I was nearly there but did not quite
make it.

It now works fine.

.......Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top