Getting away from selecting everything all the time, part 105...

nigelandrewfoster

Well-known Member
Joined
May 27, 2009
Messages
747
When I amend the recorded code

Code:
    Sheets("PRODUCTION").Select
    Range("B1:K43").Select
    ActiveSheet.PageSetup.PrintArea = "$B$1:$K$43"
    ActiveWindow.SelectedSheets.PrintOut copies:=1

    Range("B45:K87").Select
    ActiveSheet.PageSetup.PrintArea = "$B$45:$K$87"
    ActiveWindow.SelectedSheets.PrintOut copies:=1

    Range("B89:K131").Select
    ActiveSheet.PageSetup.PrintArea = "$B$89:$K$131"
    ActiveWindow.SelectedSheets.PrintOut copies:=1

    Range("B133:K176").Select
    ActiveSheet.PageSetup.PrintArea = "$B$133:$K$176"
    ActiveWindow.SelectedSheets.PrintOut copies:=1

To this:
Code:
Sheets("PRODUCTION").PageSetup.PrintArea = "$B$1:$K$43"
    ActiveWindow.SelectedSheets.PrintOut copies:=1

    Sheets("PRODUCTION").PageSetup.PrintArea = "$B$45:$K$87"
    ActiveWindow.SelectedSheets.PrintOut copies:=1

    Sheets("PRODUCTION").PageSetup.PrintArea = "$B$89:$K$131"
    ActiveWindow.SelectedSheets.PrintOut copies:=1

    Sheets("PRODUCTION").PageSetup.PrintArea = "$B$133:$K$176"
    ActiveWindow.SelectedSheets.PrintOut copies:=1

The printer only produces 4 copies of the last range, and not each in turn. What am I doing wrong, please?
Thanks
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Try like this:

Code:
With Sheets("PRODUCTION")
    .PageSetup.PrintArea = "$B$1:$K$43"
    .PrintOut copies:=1
End With
 
Upvote 0

Forum statistics

Threads
1,224,531
Messages
6,179,379
Members
452,907
Latest member
Roland Deschain

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