Note that there are some explanatory texts on larger screens.

plurals
  1. POVBA Excel Generate Unique Pages From Template and List
    primarykey
    data
    text
    <p>I have been working on this for sometime now (I am not experienced in VBA at all), but I keep getting errors so here we are.</p> <p><strong>Setup:</strong> For simplicity purposes I have two worksheets in a workbook. The first, "Daily Order", is a list of all my products, each row being a different product (approx. 1,000), each column indicating different information about the product (ie id, cost, weight, etc).<br> The second, "Template", is a pricing template that, when given product information, will generate a pricing table.</p> <p><strong>Objective:</strong> Create a VBA Macro to loop through each row of the "Daily Order" worksheet and for each row make a copy of the template sheet and append certain information to that new sheet.</p> <p><strong>What doesn't work:</strong></p> <pre><code>Sub GeneratePriceBook() Dim rw As Range Dim temp As Worksheet Dim ws As Worksheet Dim daily As Worksheet Set daily = Worksheets("Daily Order") Set temp = Worksheets("Template") temp.Activate For Each rw In daily.Rows temp.Copy After:=Sheets(Sheets.Count) Set ws = Sheets(Sheets.Count) ws.Name = rw.Value With ws .Range("A6").Formula = "='Daily Order'!B" &amp; rw.Row .Range("B6").Formula = "='Daily Order'!B" &amp; rw.Row .Range("A3").Formula = "='Daily Order'!Q" &amp; rw.Row .Range("E36").Formula = "='Daily Order'!M" &amp; rw.Row .Range("E36").Formula = "='Daily Order'!Y" &amp; rw.Row .Range("E37").Formula = "='Daily Order'!L" &amp; rw.Row End With Next rw End Sub </code></pre> <p><strong>Types of errors:</strong></p> <p>I have spent considerable time trying to isolate out certain areas that I think might be troublesome, but I keep ending up with either 424 errors or 1004 errors.</p> <p>Again, I would greatly appreciate any help. Thank you!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload