Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- https://excel-egy.com/forum/t4667
- ---------------------------------
- Private Sub CommandButton1_Click()
- Dim msg As String, fn As String, f As Boolean
- msg = MsgBox("Will You Open The PDF File?", vbQuestion + vbYesNo)
- If msg = vbYes Then f = True
- With ThisWorkbook.Sheets(1)
- fn = .Range("C6").Value
- .Range("A2:H41").ExportAsFixedFormat Type:=xlTypePDF, FileName:=ThisWorkbook.Path & "\" & fn & ".pdf", OpenAfterPublish:=f
- End With
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement