Hi everyone,
I need help with my code saving active sheet as PDF with file name as specific cell value.
File name must be combination of "F4" + "A14"
Range that must be saved: Sheet = "Estimate" and Range = (A1:G50)
Lastly cells (A23:A41) must "ClearContents" when vba is run
Currently I have this code, which save PDF fine, but thats where it stops.
Thanks
I need help with my code saving active sheet as PDF with file name as specific cell value.
File name must be combination of "F4" + "A14"
Range that must be saved: Sheet = "Estimate" and Range = (A1:G50)
Lastly cells (A23:A41) must "ClearContents" when vba is run
Currently I have this code, which save PDF fine, but thats where it stops.
VBA Code:
Private Sub CommandButton1_Click()
Dim saveLocation As String
Dim rng As Range
saveLocation = "C:\Users\****\Desktop\" & Range("f4").Value & Range("a14").Value & ".pdf"
Set rng = Sheets("Estimate").Range("A1:g50")
rng.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=saveLocation
Worksheets("Estimate").Range("A23:a41").ClearContents
End Sub
Sub saveSheetWithoutFormulas()
Worksheets("Estimate").Copy
ActiveSheet.UsedRange.Value = ActiveSheet.UsedRange.Value
ActiveWorkbook.saveas Range("f4")
End Sub
Thanks