I have a "Build Sheet" tab in my workbook, this enables us to make prints of all the details needed for each line item.
TLDR: Can you help me write a macro to call a range/array 'Build Sheet'!AF5:AF254 or from name managed "BSPrint". Into a macro that then loops to print the "Build Sheet" for each line in this "BSPrint" via cycling this range through the value in J5 of this "Build Sheet" worksheet.
Details:
I have a program that I inherited at my company. We use this program to separate, parse, and determine the details needed for a certain option available on all our orders. This option gets configured by the customer for their individual needs (custom) and this then is used to formulate the sheet details for each line item for MFG needs on factory floor. All these details are displayed on a single sheet in our program. These "Build Sheet" have a drop down input for cycling through the line items on the order. In an attempt to print this automatically, not have to manually click change each line item and then click print, I have parsed out the order line items and removed all blanks where applicable to enable me to use a VBA macro to call the range/array of printable line items. In this tab we cycle our orders through by line item. I want to use this setup with the range/array to print only the needed orders details (eg. line item 2, 4, 5, 10, 15, 20).
My attempt:
Dim vars As Range, i As Long
vars = ThisWorkbook.Worksheets("Build Sheet").Range("AF5:AF254")
For i = LBound(vars) To UBound(vars)
[J5] = vars(i)
Worksheet.PrintOut
Next i
TLDR: Can you help me write a macro to call a range/array 'Build Sheet'!AF5:AF254 or from name managed "BSPrint". Into a macro that then loops to print the "Build Sheet" for each line in this "BSPrint" via cycling this range through the value in J5 of this "Build Sheet" worksheet.
Details:
I have a program that I inherited at my company. We use this program to separate, parse, and determine the details needed for a certain option available on all our orders. This option gets configured by the customer for their individual needs (custom) and this then is used to formulate the sheet details for each line item for MFG needs on factory floor. All these details are displayed on a single sheet in our program. These "Build Sheet" have a drop down input for cycling through the line items on the order. In an attempt to print this automatically, not have to manually click change each line item and then click print, I have parsed out the order line items and removed all blanks where applicable to enable me to use a VBA macro to call the range/array of printable line items. In this tab we cycle our orders through by line item. I want to use this setup with the range/array to print only the needed orders details (eg. line item 2, 4, 5, 10, 15, 20).
My attempt:
Dim vars As Range, i As Long
vars = ThisWorkbook.Worksheets("Build Sheet").Range("AF5:AF254")
For i = LBound(vars) To UBound(vars)
[J5] = vars(i)
Worksheet.PrintOut
Next i