Posts by ldcycler

    I have two worksheets, YTD and July. I want to select A1:K48 on the YTD worksheet and A1:G45 on the July worksheet and then export that selection to a pdf file on the e:\saved folder with the name July2017. I get an error on the Set rng line of code. Here is what I have done and appreciate any help on this. Thank you

    Private Sub cmdPrintJul_Click()

    Set rng = Worksheets("YTD").Range("A1:K48", Worksheets("July").Range("A1:G45"))

    Selection.ExportAsFixedFormat _
    Type:=xlTypePDF, _
    FileName:="e:\saved\July2016.pdf", _
    Quality:=xlQualityStandard, _
    IncludeDocProperties:=True, _
    IgnorePrintAreas:=False, _


    End Sub