Macro to create new invoice

M

MB

Hi,

I would like to create a macro which clears the contents of selected cells,
creates a new invoice number by adding 1 to the previous number then saves
the document.

I am OK with the clearing cells and saving worksheet part of the macro but I
am not sure how to add the number to the invoice. Any help appreciated.
 
C

Conan Kelly

MB,

Where is the invoice number? A cell in the sheet? Sheet name (on the sheet
tab)?

Conan
 
C

Cimjet

Hi MB
Are you asking to add to your macro a way to increment a number let say
012345 in cell D1 everytime you execute the macro??
Regards
Cimjet
 
M

MB

Yes, that's what I'm trying to do.


Cimjet said:
Hi MB
Are you asking to add to your macro a way to increment a number let say
012345 in cell D1 everytime you execute the macro??
Regards
Cimjet
 
M

MB

Yes, there is only one sheet and the invoice number is in a cell, I am
trying to get it to advance by one every time I create a new invoice and at
the same time clear the details from other cells used in the previous
invoice.
 
J

jatman

somewhere on the sheet is where you have your current invoice number, let's
just say K8 is where you have your invoice number.

next, somewhere in your macro, you need to add the following

mycount = Range("K8") + 1
Range("K8") = mycount

hope that helps,

jatman.
 
M

MB

Works perfectly. Thanks very much :}
jatman said:
somewhere on the sheet is where you have your current invoice number,
let's
just say K8 is where you have your invoice number.

next, somewhere in your macro, you need to add the following

mycount = Range("K8") + 1
Range("K8") = mycount

hope that helps,

jatman.
 

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