Hi all,
Does anyone have a code that can be attached to a cmd button on a userform that will copy the worksheet as displayed in "combobox1" to the desktop as a PDF file? Trying to record the macro but failing miserably, this is my code so far & any assistance will be greatly appreciated, thank you all & have a great day
Private Sub CommandButton5_Click()
Set ws = Worksheets(Me.ComboBox1.Value)
If Blank Then
MsgBox "Please Enter Branch"
Exit Sub
End If
Worksheets(Me.ComboBox1.Value).Select
ChDir "C:\Users\username\Desktop"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\Users\username\Desktop\Rcd1.pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
True
Application.ScreenUpdating = True
End Sub
Bookmarks