Microsoft Excel - print by macro - Asked By narendra patel on 09-Mar-13 04:15 AM

Dear all

My problem  print sheet of macro order then print one copy and rest printer some time let second copy print and rest printer some time rest and therd copy print.  I want to order print and fast print copy (Original, Duplicate and Triplicate)
My code:

Sub Macroprint()
'
' '
    Dim i As Integer
    Worksheets("DIVY").Select
    Worksheets("DIVY").PageSetup.PrintArea = "$A$1:$N$41"
    For i = 1 To 3
    Select Case i
      Case 1
      ActiveSheet.Range("K2").Value = "Original"
      Case 2
      ActiveSheet.Range("K2").Value = "Duplicate"
      Case 3
      ActiveSheet.Range("K2").Value = "Triplicate"
    End Select
   ActiveSheet.PrintOut copies:=1, collate:=True
   Next i
    ActiveSheet.Range("k2").ClearContents
End Sub

Harry Boughen replied to narendra patel on 12-Mar-13 11:06 PM
Hello Narenda,
Do I understand correctly that you wish to introduce a time delay between the printing of the three items?  if so, how long do you wish the delay to be?
Regards
Harry
narendra patel replied to Harry Boughen on 13-Mar-13 01:53 AM


Hello Harry

One second delay between twthe printing copy.

Ihave one sheet there three copy print one copy (Original), Second copy(Duplicate) and third copy (assesse).

Regards.
Harry Boughen replied to narendra patel on 13-Mar-13 02:25 AM
Hello Narendra,
Perhaps this will do what you want.
The time delay is currently at 10 seconds by the last two digits inside the TimeValue expression.  You can change these to whatever number of seconds you want.
Sub Macroprint()

    Dim i As Integer
    Dim alertTime As Variant
    
    Worksheets("DIVY").Select
    Worksheets("DIVY").PageSetup.PrintArea = "$A$1:$N$41"
    For i = 1 To 3
      Select Case i
      Case 1
      ActiveSheet.Range("K2").Value = "Original"
      Case 2
      ActiveSheet.Range("K2").Value = "Duplicate"
      Case 3
      ActiveSheet.Range("K2").Value = "Triplicate"
      End Select
      alertTime = Now + TimeValue("00:00:10")
      Application.Wait (alertTime)
      ActiveSheet.PrintOut copies:=1, collate:=True
    Next i
    
    ActiveSheet.Range("K2").ClearContents
    
End Sub

Regards
Harry
narendra patel replied to Harry Boughen on 13-Mar-13 02:34 AM

shorry Herry

I have want to no wait print copy.

I have contunues print copy.

Regards,
Harry Boughen replied to narendra patel on 13-Mar-13 02:56 AM
Sorry Narendra,
I do not understand what you want.  Your original macro prints three copies (original, duplicate and triplicate) at a rate that is limited by the speed of your printer to produce a page (for my printer about 10-15seconds per page).  It can't be made to happen any faster than that.
Perhaps if you can get somebody to explain more clearly what the problem really is we might be able to help further.
Regards
Harry