Hello,
here below is my Workbook with 2 worksheets.
Worksheet Label and Worksheet Print Packing.
Does anyone have idea about loop through rows of Packing List, to fill Label and save it as pdf for each non-empty row (reference could be ID column in packing list)?
I would go with something like this:
But it does not work, because I do not know to set Filename of PDF between two & & .
If anyone have idea, how this could work, I would be thankful !
Djordje
here below is my Workbook with 2 worksheets.
Worksheet Label and Worksheet Print Packing.
Does anyone have idea about loop through rows of Packing List, to fill Label and save it as pdf for each non-empty row (reference could be ID column in packing list)?
I would go with something like this:
VBA Code:
Sub Print_Labels()
Dim i As Range
For Each i In Worksheets("Print Packing").Range("A6:A30").Value
If IsEmpty(Range("A6:A30").Value) Then
End If
' this part should copy data to labels and save them as they are each row
With Sheets("LABEL")
.[A11] = Range("E6:E30")
.[C16] = Intersect(i.EntireRow, Range("I6:I30"))
.[C18] = Intersect(i.EntireRow, Range("N6:N30"))
End With
ThisWorkbook.Worksheets("LABEL").ExportAsFixedFormat Type:=xlTypePDF, _
FileName:="C:\Users\logistics.rs\Desktop\New folder\" & & ".pdf"
Next
End Sub
But it does not work, because I do not know to set Filename of PDF between two & & .
If anyone have idea, how this could work, I would be thankful !
Djordje