I have made invoice system in excel. Where there is a customer name and id which is used as a invoice number. And other details are there as well. I have added a save Button in excel to save my worksheet with the following vb:
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:="C:\PDF\Export.pdf", _
OpenAfterPublish:=False
Application.ScreenUpdating = True
End Sub
Now, it just saves with the 'Export' name. So every time I save it will have the same name. But I want the save button allow me name the sheet before I save the sheet. Or, is there any way the name of the pdf I save can be according to two cell values in order? Also I want the saved pdf to be opened when this Save button is clicked.
Is it not possible to retrieve the filename from the three different cells in order. J5&J6 for Invoice number, K5&K6 customer name and L8 for status? Is it not possible if the same button will also save certain cell values in another sheet?
