Hi
I have a worksheet with a single listbox. I need to loop through all the values in the listbox and make a PDF of the sheet. (The listbox items change all the values on the worksheet). I've searched and found some code that should work, but it isn't and I have no idea what is wrong.
This is my code. It is stopping at:
.
Any help would be massively appreciated
Thanks
I have a worksheet with a single listbox. I need to loop through all the values in the listbox and make a PDF of the sheet. (The listbox items change all the values on the worksheet). I've searched and found some code that should work, but it isn't and I have no idea what is wrong.
This is my code. It is stopping at:
Code:
For i = 0 To ListBox3.ListCount - 1
Code:
Sub ExportToPDF()
Dim filename As String
Dim i As Integer
For i = 0 To ListBox3.ListCount - 1
If ListBox3.Selected(i) Then
filename = Range("A13").Value
Sheets("Working Results Sheet").ExportAsFixedFormat xlTypePDF, "filepath is here" & filename & ".pdf"
End If
Next i
End Sub
Any help would be massively appreciated
Thanks