• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

[Solved] VBA Code for Automatic Printout on spesific sheet

nofri09

New Member
Dear All

Could someone teach me the code for automatic printout , case ;
1. the automatic printout only 1 time for example every 18:00 p.m
2. then, there is 5 sheet, and the automatic printout only sheet 2, sheet 3, & sheet 4

I hope some one can help me
thankyou verymuch
 
Code:
Sub PrintAllSheets()                               
    'Assuming first sheet name is in cell D2:                               
    Dim c As Range                               
                                    
    'loop through all values in column D                               
    For Each c In Range("D2:D" & Range("D" & Rows.Count).End(xlUp).Row)                               
        Worksheets(c.Value).PrintOut                               
    Next c                               
End Sub

Code:
Private Sub Workbook_Open( )
     Application.OnTime TimeValue("15:00:00"), "MyMacro"
End Sub
 
Code:
Sub PrintAllSheets()                              
    'Assuming first sheet name is in cell D2:                              
    Dim c As Range                              
                                   
    'loop through all values in column D                              
    For Each c In Range("D2:D" & Range("D" & Rows.Count).End(xlUp).Row)                              
        Worksheets(c.Value).PrintOut                              
    Next c                              
End Sub

Code:
Private Sub Workbook_Open( )
     Application.OnTime TimeValue("15:00:00"), "MyMacro"
End Sub

Thankyou verymuch

it is solved
 
Code:
Sub PrintAllSheets()                             
    'Assuming first sheet name is in cell D2:                             
    Dim c As Range                             
                                  
    'loop through all values in column D                             
    For Each c In Range("D2:D" & Range("D" & Rows.Count).End(xlUp).Row)                             
        Worksheets(c.Value).PrintOut                             
    Next c                             
End Sub

Code:
Private Sub Workbook_Open( )
     Application.OnTime TimeValue("15:00:00"), "MyMacro"
End Sub

I used this code

Code:
        DoEvents                ' Print Process
        If w_sMemoryTime = "18:00:00" Then
            Sheets(Array("1C Ink Flow", "2C Ink Flow", "6C Ink Flow")).PrintOut
        End If
 
Last edited by a moderator:
Back
Top