Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50139

Macro wont run past the first print page

$
0
0
I made a macro that checks a cell on each page of my sheet if that cell =1 then it prints it, if it =0 then it doesn't, but I don't have the macro right because it wont go past the first page can anyone help
Thanks from the Novice

Code:

Sub WedPrintchecklist()
'
' WedPrintchecklist Macro
' prints the excavation checklist but only the pages that have a certian cell filled

    Sheets("Wed Excavation Inspection").Select
' Page 1
    If Range("dk32").Value = 1 Then
        ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
        :=True, IgnorePrintAreas:=False

 ' Page 2
        If Range("dn187").Value = 1 Then
            ActiveWindow.SelectedSheets.PrintOut From:=2, To:=2, Copies:=1, Collate _
        :=True, IgnorePrintAreas:=False

  ' Page 3
            If Range("dn342").Value = 1 Then
                ActiveWindow.SelectedSheets.PrintOut From:=3, To:=3, Copies:=1, Collate _
        :=True, IgnorePrintAreas:=False

               
             
          End If
        End If
    End If
   
    'Add the other sheets as needed
   
End Sub


Viewing all articles
Browse latest Browse all 50139

Trending Articles