<colgroup><col width="69"><col span="7" width="64"><col width="71"><col width="85"></colgroup><tbody>
</tbody>
I am hoping to learn how to setup a unique list of vendors (VendorList) from a list using a named range, then loop through that list in a VBA macro that is using filters. Each worksheet is named after the vendor and so is the table. So worksheet Vendor1 table Vendor1. My main sheet is called Orders and where we import all of the items to be ordered for the day. I know what vendors I have but not all will be ordered daily. I will add sheets to the workbook as we add vendors and I thought that this should be fairly simple but the simplicity has alluded me. We then do a print of each worksheet that had an order for the day. Thank you in advance.
So basically loop through unique list of vendors VendorList and do this code for each i in VendorList
Sheets("ORDERS").Select
ActiveSheet.ListObjects("Orders").Range.AutoFilter Field:=2, Criteria1:= _
"i"
Do While Range("Orders") <> ""
Range("Orders").Select
Selection.Copy
Sheets("i").Select
Range("i").Select
ActiveSheet.Paste
ActiveWindow.SelectedSheets.PrintPreview
[TABLE="width: 196"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]VendorName
[/TD]
[TD]ProductID[/TD]
[/TR]
[TR]
[TD]Vendor1[/TD]
[TD]Vendor18969-01[/TD]
[/TR]
[TR]
[TD]Vendor1[/TD]
[TD]Vendor18969-02[/TD]
[/TR]
[TR]
[TD]Vendor1[/TD]
[TD]Vendor18969-03[/TD]
[/TR]
[TR]
[TD]Vendor1[/TD]
[TD]Vendor18969-04[/TD]
[/TR]
[TR]
[TD]Vendor2[/TD]
[TD]Vendor28969-04[/TD]
[/TR]
[TR]
[TD]Vendor2[/TD]
[TD]Vendor28969-05[/TD]
[/TR]
[TR]
[TD]Vendor2[/TD]
[TD]Vendor28969-06[/TD]
[/TR]
[TR]
[TD]Vendor2[/TD]
[TD]Vendor28969-07[/TD]
[/TR]
[TR]
[TD]Vendor2[/TD]
[TD]Vendor28969-08[/TD]
[/TR]
[TR]
[TD]Vendor2[/TD]
[TD]Vendor28969-15[/TD]
[/TR]
[TR]
[TD]Vendor3[/TD]
[TD]Vendor38969-15[/TD]
[/TR]
[TR]
[TD]Vendor3[/TD]
[TD]Vendor38969-16[/TD]
[/TR]
[TR]
[TD]Vendor3[/TD]
[TD]Vendor38969-16[/TD]
[/TR]
[TR]
[TD]Vendor3[/TD]
[TD]Vendor38969-16[/TD]
[/TR]
</tbody>[/TABLE]