Macro to create new invoice

  • Thread starter Thread starter MB
  • Start date Start date
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.
 
MB,

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

Conan
 
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
 
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
 
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.
 
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.
 
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.
 
Back
Top