I need a macro that will save the range of cells with values as a pdf and saved as the sheet name. I have a macro that does a print preview function based on the cells that contain values. It works great, but instead I just need this to be saved as a pdf.
This is what I have:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim LastRow As Integer
Dim WhatToPrint As Range
LastRow = ActiveSheet.Range("A65535").End(xlUp).Row
Set WhatToPrint = ActiveSheet.Range("A1").Resize(LastRow, 19)
End Sub
'I would like to use the Button I have set up as well.
Private Sub CommandButton1_Click()
Dim LastRow As Integer
Dim WhatToPrint As Range
LastRow = ActiveSheet.Range("A65535").End(xlUp).Row
Set WhatToPrint = ActiveSheet.Range("A1").Resize(LastRow, 19)
WhatToPrint.PrintPreview
End Sub
Any help is greatly appreciated.
Thanks
Bookmarks