hello
I need setting the borders & formatting where showing data in listbox on userform after save PDF . so when show the data in listbox on userform or select item in combobox1 and populate data in listbox when press commandbutton1 should show the same formatting and borders as in sheet1 when save the file as pdf
this is the code for saving data as pdf
Private Sub CommandButton1_Click()
ListBoxToPDF ListBox1, ThisWorkbook.Path & "\ListBoxToPDF.pdf"
Unload Me
End Sub
Sub ListBoxToPDF(listbox As Object, pdf As String)
With Workbooks.Add(xlWBATWorksheet).Worksheets(1)
.Range("A1").Resize(listbox.ListCount, listbox.ColumnCount) = listbox.List
.ExportAsFixedFormat Type:=xlTypePDF, Filename:=pdf _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False
.Parent.Close False
End With
End Sub