New invoice number

Jenny809

New Member
Joined
Aug 12, 2019
Messages
5
Hi there! I am trying to create a code that will generate a new invoice number on my worksheet. I have cell H4 with a vendor number that is four digits long. I would like the invoice number to include the vendor number somehow 5647-78 for example. Could you please help me?
 
I tried the code. I got an error message. So i tried removing the first part of the code and i was able to get a number (vendor-01) but the 01 is not changing as i create a new invoice.
When i change the vendor and run the macro, it gives me the same thing (vendor -01). How can i make it keep counting or simply adding a 1 to the previous invoice?
 
Upvote 0

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
So i tried removing the first part of the code
What exactly did you remove?
What does your current code look like?

Please put the code back to where I had it, and let me know the following:
- What is in cells HJ3 and H4 to start?
- What is the exact error message you are receiving?
- If you click on the "Debug" option when you get the error message, what line of code does it highlight?
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,492
Members
448,967
Latest member
visheshkotha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top