VBA code needed to create multiple individual workbooks using template and table of data

andyporter1975

New Member
Joined
Feb 3, 2014
Messages
27
Hello,

If anyone can help me with VBA code for the following it would be greatly appreciated.

I have a table of data which contains multiple rows and columns. Each row relates to a unique business and each column contains data relating to that business.

Using a pre-defined excel doc as a template, I want to be able to automatically populate this template with the info for one businesses into a specific row on the template, save it as the name given in one of the cells into a local folder and then do the same for each and every row within the original table of data.

Is this possible??

Thank you in advance for any hep suggested.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Hello,

I am sad to not see any reply. I am looking for the same thing. Kind of a merge customer list with a template with formulas and save a workbook per customer with their name in the file format.

Thank you
 
Upvote 0
Hello,

I am sad to not see any reply. I am looking for the same thing. Kind of a merge customer list with a template with formulas and save a workbook per customer with their name in the file format.

Thank you
Although imagination is limitless, but it would help us if we have an example of the datasheet, and it'll be great if you tell us how it should work in detail. So, we can help you easier and faster
 
Upvote 0
Although imagination is limitless, but it would help us if we have an example of the datasheet, and it'll be great if you tell us how it should work in detail. So, we can help you easier and faster
1631089477041.png

1631089525991.png
 
Upvote 0
Let me imagine the flow ;)
You have:
1) Template workbook
2) Data workbook(s) (Probably you have multiple of data workbooks in a specific folder)

I imagine that your Template workbook is where your VBA code would reside.
You run the program. Browse to workbook data folder.
It will copy necessary data from the data workbook into template.
Save the Template workbook as another workbook free of macro.
Clear the template and work on next data workbook perhaps.

Now we have how the template looks like but how the data workbook looks like? Are you looking for specific sheet in the data workbook to extract data from?
 
Upvote 0
Sorry, I thought Andy has given some info.
Currently we put the customer code in sheet.J3 and save as in a specific folder with the file format in sheet.E2. i's very long with 500 customers
I would run a Macro to leave the template open and do the same thing for the customer list in the second tab. I have listed 10 for this example.
Thank you very much

Tab Sheet
Template.xlsm
BCDEFGHIJKLMNOPQ
1File nameNotice: The prices and amounts are for references only and may vary upon billing depending on the departure site and the delivery method. This worksheet is not an official order, Techo-Bloc reserves the right to modify its content without prior notice.
2030-000419-PANTANO NURSERY
3000419
4CONTRACTID20-USA
5Code000419CUSTITEMRESTRICTIONGROUPIDUSAREP:GROUP030-Ryan RavalliDate
6NamePANTANO NURSERYINVENTSITEIDPENBill to:000419 TOTAL
7Shipping143 FREEHOLD ROADPRICEGROUPUS-NJ-SE-NYPANTANO NURSERYQTSLINES AMOUNT
8CityMANALAPANLINEDISCUS-BKG_00GROUP030-Ryan Ravalli000.00
9StateNJBooking Discount5%Authorized1,600,000.00
10CodeDescriptionOriginItem Restriction GroupRkPriceDiscPrice PickUp ORIGINPromo %Promo $Net Price OriginUN SalesORD QTS ORD UNITUN Sales Per ORD UNITAMOUNT
Sheet
Cell Formulas
RangeFormula
E2E2=CONCAT(MID(J8,6,3),"-",C5,"-",C6)
H4H4=VLOOKUP($C$5,CustGroup[#All],2,FALSE)
H5H5=VLOOKUP($C$5,CustGroup[#All],7,FALSE)
H6H6=VLOOKUP($C$5,CustGroup[#All],3,FALSE)
J5J5=VLOOKUP($C$5,REP[[#All],[CUSTOMERRELATION]:[NAME]],3,FALSE)
J6J6=VLOOKUP($C$5,CUST[#All],2,FALSE)
H7H7=VLOOKUP($C$5,CustGroup[#All],4,FALSE)
I7I7=VLOOKUP($J$6,CUST[#All],3,FALSE)
J8J8=VLOOKUP($J$6,REP[[#All],[CUSTOMERRELATION]:[NAME]],3,FALSE)
N8,Q8N8=SUM(N11:N1086)
O8O8=COUNT(N11:N1086)
C5C5=J3
C6C6=VLOOKUP($C$5,CUST[#All],3,FALSE)
C7C7=VLOOKUP($C$5,CUST[#All],4,FALSE)
C8C8=VLOOKUP($C$5,CUST[#All],5,FALSE)
C9C9=VLOOKUP($C$5,CUST[#All],6,FALSE)
Q9Q9=IFERROR(VLOOKUP(C5,LIMIT,8,FALSE),"Split Bill To Limit")
Named Ranges
NameRefers ToCells
LIMIT!Print_Area=LIMIT!$A$2:$H$217Q9
Customer!Print_Titles=Customer!$1:$1C6:C9, I7, J6
'Customer Save as'!Print_Titles=Customer!$1:$1C6:C9, I7, J6
'Cust Price Group'!Query_from_AX='Cust Price Group'!$A$1:$N$584H4:H7
Cells with Conditional Formatting
CellConditionCell FormatStop If True
H9Cell Value=0textNO
B8,B10,B1:B4Cell ValueduplicatestextNO
 
Upvote 0
Sorry, I thought Andy has given some info.
Currently we put the customer code in sheet.J3 and save as in a specific folder with the file format in sheet.E2. i's very long with 500 customers
I would run a Macro to leave the template open and do the same thing for the customer list in the second tab. I have listed 10 for this example.
Thank you very much

Tab Sheet
Template.xlsm
BCDEFGHIJKLMNOPQ
1File nameNotice: The prices and amounts are for references only and may vary upon billing depending on the departure site and the delivery method. This worksheet is not an official order, Techo-Bloc reserves the right to modify its content without prior notice.
2030-000419-PANTANO NURSERY
3000419
4CONTRACTID20-USA
5Code000419CUSTITEMRESTRICTIONGROUPIDUSAREP:GROUP030-Ryan RavalliDate
6NamePANTANO NURSERYINVENTSITEIDPENBill to:000419 TOTAL
7Shipping143 FREEHOLD ROADPRICEGROUPUS-NJ-SE-NYPANTANO NURSERYQTSLINES AMOUNT
8CityMANALAPANLINEDISCUS-BKG_00GROUP030-Ryan Ravalli000.00
9StateNJBooking Discount5%Authorized1,600,000.00
10CodeDescriptionOriginItem Restriction GroupRkPriceDiscPrice PickUp ORIGINPromo %Promo $Net Price OriginUN SalesORD QTS ORD UNITUN Sales Per ORD UNITAMOUNT
Sheet
Cell Formulas
RangeFormula
E2E2=CONCAT(MID(J8,6,3),"-",C5,"-",C6)
H4H4=VLOOKUP($C$5,CustGroup[#All],2,FALSE)
H5H5=VLOOKUP($C$5,CustGroup[#All],7,FALSE)
H6H6=VLOOKUP($C$5,CustGroup[#All],3,FALSE)
J5J5=VLOOKUP($C$5,REP[[#All],[CUSTOMERRELATION]:[NAME]],3,FALSE)
J6J6=VLOOKUP($C$5,CUST[#All],2,FALSE)
H7H7=VLOOKUP($C$5,CustGroup[#All],4,FALSE)
I7I7=VLOOKUP($J$6,CUST[#All],3,FALSE)
J8J8=VLOOKUP($J$6,REP[[#All],[CUSTOMERRELATION]:[NAME]],3,FALSE)
N8,Q8N8=SUM(N11:N1086)
O8O8=COUNT(N11:N1086)
C5C5=J3
C6C6=VLOOKUP($C$5,CUST[#All],3,FALSE)
C7C7=VLOOKUP($C$5,CUST[#All],4,FALSE)
C8C8=VLOOKUP($C$5,CUST[#All],5,FALSE)
C9C9=VLOOKUP($C$5,CUST[#All],6,FALSE)
Q9Q9=IFERROR(VLOOKUP(C5,LIMIT,8,FALSE),"Split Bill To Limit")
Named Ranges
NameRefers ToCells
LIMIT!Print_Area=LIMIT!$A$2:$H$217Q9
Customer!Print_Titles=Customer!$1:$1C6:C9, I7, J6
'Customer Save as'!Print_Titles=Customer!$1:$1C6:C9, I7, J6
'Cust Price Group'!Query_from_AX='Cust Price Group'!$A$1:$N$584H4:H7
Cells with Conditional Formatting
CellConditionCell FormatStop If True
H9Cell Value=0textNO
B8,B10,B1:B4Cell ValueduplicatestextNO
second tab, customer list
Template.xlsm
ABC
1Customer accountInvoice accountName
2000775000775447 CORNERSTONE PRODUCTS
30004420004429 BROTHERS BUILDING SUPPLY CORP.
40019710004429 BROTHERS BUILDING SUPPLY CORP.
5000664000664903 LANDSCAPE SUPPLY INC
6002581002581A LOT MASON SUPPLY CORP
7000001000001A&B KEARNS TRKG & STONE CENTER
8002578000001A&B KEARNS TRKG & STONE CENTER
9002356002356A, B & D ENTERPRISES LLC / DBA BEDROCK GARDENS
10000419000419PANTANO NURSERY
11000157000157DEMARCO BROTHERS INC
Customer Save as
 
Upvote 0
Let me imagine the flow ;)
You have:
1) Template workbook
2) Data workbook(s) (Probably you have multiple of data workbooks in a specific folder)

I imagine that your Template workbook is where your VBA code would reside.
You run the program. Browse to workbook data folder.
It will copy necessary data from the data workbook into template.
Save the Template workbook as another workbook free of macro.
Clear the template and work on next data workbook perhaps.

Now we have how the template looks like but how the data workbook looks like? Are you looking for specific sheet in the data workbook to extract data fr
 
Upvote 0
Hello, currently, I hide the sheets that I don't want the customer see, I put security on the sheets and the workbook and save as for everyone.
May be we can copy only the first sheet with the formulas with no error for the one linked to the others sheets ? we break the link with past value ?

Thank you
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,279
Members
449,075
Latest member
staticfluids

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