Macro to auto number invoices & save as a new specified filename

ecSurf

New Member
Joined
Apr 30, 2016
Messages
2
Hello

I hope you can help me as I am really new with macros in Excel

I have a Purchase Order form that I need to get a new number every time I open the template and, when finished (closing/saving and/or priniting), the default saving name be a construction of fields and texts from within the form.

In specific, I need the file to be named as: PO12345 - YYYYMMDD - VENDOR, where PO is text, 12345 is the automatically generated number from field G5, the text " - ", YYYYMMDD being the year-month-date in field G12 and finally the vendor name from field C11

I hope you can help me with the needed VBA code.

Thanks
Captura%20de%20pantalla%202016-04-29%20a%20las%2023.11.01.png
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Hi welcome to the board.

There is plenty out there on this subject - as an example:https://blogs.office.com/2012/01/12/generate-invoice-numbers-in-excel/

The instruction looks at invoices but easily changed for your requirement.

As an alternative suggestion, rather than store many copies of individual PO why not save the record to another worksheet (database)? with all purchasing history in one place you can run reports, create pivot tables, graphs etc.

Hope helpful

Dave
 
Upvote 0
Thanks Dave.

I read the link you suggested and will try it... one important issue I have to face is the MacOS file/folder structure which is different to PC's and complicates the destination route.

As for your suggestion, can you elaborate more on what can I do to have a better system for my POs

Thanks a again.
 
Upvote 0
Thanks Dave.



As for your suggestion, can you elaborate more on what can I do to have a better system for my POs

Thanks a again.


Your purchase order form becomes an input template & you would write the data to another worksheet / workbook (database)
By placing data in this format it makes it much easier to search, review / update & create reports / charts etc.

I offered similar suggestion to another on this board & provided some suggested code here:http://www.mrexcel.com/forum/excel-...pulate-separate-form-based-data-inputted.html

I have no experience of mac operating systems but you should be able to adapt the idea if want to develop it further.

Hope Helpful

Dave
 
Upvote 0

Forum statistics

Threads
1,217,364
Messages
6,136,117
Members
449,993
Latest member
Sphere2215

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