Need to add to this code to print copies of sheets created after macro is ran

steve400243

Active Member
Joined
Sep 15, 2016
Messages
429
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hello, This is part of a code that creates files, then prints out 2 copies of Sheet 3 "FREIGHT TAGS", I need the code to also print out 2 copies of "DEVAN SHEET", and 1 copy of "CFS SHEET". I cannot figure out how to work this in. Thanks in advance.

VBA Code:
ws1.Range("A13", "N38").ClearContents
            ws1.Range("A13").Resize(UBound(sn), 14) = sn: ws1.Range("C3") = Key
            Sheets(Array("CFS SHEET", "DEVAN SHEET", "FREIGHT TAGS", "DATA")).Copy
            ActiveWorkbook.SaveAs CreateObject("WScript.Shell").specialfolders("Desktop") & "\" & ws1.Range("C4") & " - " & Key, 52: ActiveWorkbook.Close False
            For i = 1 To UBound(sn)
                Sheet3.Range("A8") = sn(i, 1)
                Sheet3.Range("D8") = sn(i, 3)
                Sheet3.Range("G8") = sn(i, 4)
                Sheet3.Range("A11") = sn(i, 5)
                Sheet3.Range("D11") = sn(i, 6)
                Sheet3.Range("G11") = sn(i, 2)
                Sheet3.Range("A1:I24").PrintOut COPIES:=2
            Next
        Next
    End With
End Sub
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Your phrase "work this in" implies that you have ideas about what that means that you have not described in your post. But to keep it simple for now, assuming

VBA Code:
 Sheet3.Range("A1:I24").PrintOut COPIES:=2

Is working for you, Why not just add two more printout statements?

VBA Code:
Sheets("DEVAN SHEET").Range("A1:I24").PrintOut COPIES:=2
Sheets("CFS SHEET").Range("A1:I24").PrintOut COPIES:=1
 
Upvote 0
Solution
Your phrase "work this in" implies that you have ideas about what that means that you have not described in your post. But to keep it simple for now, assuming

VBA Code:
 Sheet3.Range("A1:I24").PrintOut COPIES:=2

Is working for you, Why not just add two more printout statements?

VBA Code:
Sheets("DEVAN SHEET").Range("A1:I24").PrintOut COPIES:=2
Sheets("CFS SHEET").Range("A1:I24").PrintOut COPIES:=1
Thank you for pointing out the obvious to me rlv01, Should have been able to figure that out. Appreciate your response, works as needed. Enjoy the weekend!
 
Upvote 0

Forum statistics

Threads
1,214,376
Messages
6,119,172
Members
448,870
Latest member
max_pedreira

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top