Forum Discussion

Lorenzo Kim's avatar
Lorenzo Kim
Bronze Contributor
Jul 24, 2018

VBA not printing!

Something is not right with the SUB below -- it is NOT PRINTING!!

what could be wrong with the codes... pls help

many many thanks

 

Sub Print_Final_synopsis()

    Dim ws As Worksheet   

    Dim rng As Range

    Dim printRange As String

    Set ws = ActiveSheet 

    Range("A1:I50" ).Select

    Set rng = Selection

    printRange = ws.Name & "!" & rng.Address 

    With ws.PageSetup

       .PrintArea = printRange

       .Zoom = False

       .FitToPagesWide = 1

       .Orientation = xlLandscape

    End With

End Sub

 

  • Lorenzo Kim's avatar
    Lorenzo Kim
    Bronze Contributor

    NOW IT IS PRINTING !!

    I HOPE THIS COULD HELP SOMEONE ELSE WITH SAME SCENARIO

     

    Sub Print_Final_synopsis()

        Dim ws As Worksheet

        Dim rng As Range

        Dim printRange As String

        Set ws = ActiveSheet

        Range("A1:I50" ).Select

        Set rng = Selection

        printRange = ws.Name & "!" & rng.Address

        With ws.PageSetup

            .PrintArea = printRange

            .Zoom = False

            .FitToPagesWide = 1

            .Orientation = xlLandscape

        End With

        Selection.PrintOut     ***** THIS IS THE ONE MISSING TO PRINT

    End Sub

Resources