How to print a name range using check boxes

ABabeNChrist
SilverLounger
Posts: 1868
Joined: 25 Jan 2010, 14:00
Location: Conroe, Texas

How to print a name range using check boxes

Post by ABabeNChrist »

I was wondering how I might use a name range to print using check boxes.
At the present moment I use this method to print.

Code: Select all

If CheckBox4.Value = True Then
     Sheets("Grounds").Select
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    End If
    If CheckBox7.Value = True Then
     Sheets("Roof").Select
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    End If
   End Sub

User avatar
mbarron
2StarLounger
Posts: 112
Joined: 25 Jan 2010, 20:19

Re: How to print a name range using check boxes

Post by mbarron »

You can use:

Code: Select all

Range("myRangeName").PrintOut Copies:=1, Collate:=True

ABabeNChrist
SilverLounger
Posts: 1868
Joined: 25 Jan 2010, 14:00
Location: Conroe, Texas

Re: How to print a name range using check boxes

Post by ABabeNChrist »

Hi mbarron
That was easy enought
it worked FANTASIC
Thank you so much

Code: Select all

Range("myRangeName").PrintOut Copies:=1, Collate:=True
[/quote]

GeoffW
PlatinumLounger
Posts: 4183
Joined: 24 Jan 2010, 07:23

Re: How to print a name range using check boxes

Post by GeoffW »

Use of "Select" does slow down VBA execution, especially where used frquently.

Many times it can be coded out, but the trouble is that many people start by recording macros and using the generated code- and this often involves selecting.