Hi wonderful people.
My last enquiry is that I now have one more question.
I have written a macro to automatically pdf my document, but when I had rows, I then have a to manually adjust to suit my macros for adding columns and rows.
Is there anyway for this code to automatically update when I had rows. So for example I don't want to print below row 22 at the moment but by adding a row this then chops the information by one line and I have to manually adjust each time.
Also when creating the pdf, can I get an option to save to a location of my choice as this currently just saves to my documents on which ever computer I am using at the time. So basically I get a local copy and then have to rename and save to a network.
Please see the code I am using:
Sub Button2_Click()
Dim sFile As String
sFile = Application.DefaultFilePath & "" & _
ActiveWorkbook.Name & ".pdf"
Sheets("Notes for Quotes").Select
ActiveSheet.PageSetup.PrintArea = "A1:I22"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=sFile, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=True
End Sub
Again, thank you so much for all your help.
Kind regards,
Sean
My last enquiry is that I now have one more question.
I have written a macro to automatically pdf my document, but when I had rows, I then have a to manually adjust to suit my macros for adding columns and rows.
Is there anyway for this code to automatically update when I had rows. So for example I don't want to print below row 22 at the moment but by adding a row this then chops the information by one line and I have to manually adjust each time.
Also when creating the pdf, can I get an option to save to a location of my choice as this currently just saves to my documents on which ever computer I am using at the time. So basically I get a local copy and then have to rename and save to a network.
Please see the code I am using:
Sub Button2_Click()
Dim sFile As String
sFile = Application.DefaultFilePath & "" & _
ActiveWorkbook.Name & ".pdf"
Sheets("Notes for Quotes").Select
ActiveSheet.PageSetup.PrintArea = "A1:I22"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=sFile, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=True
End Sub
Again, thank you so much for all your help.
Kind regards,
Sean