ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Select Multiple Ranges with Certain Data to Print (https://www.excelbanter.com/excel-programming/400810-select-multiple-ranges-certain-data-print.html)

RyanH

Select Multiple Ranges with Certain Data to Print
 
I am a beginner with VBA and I am not sure how to begin with this. I have a
worksheet of product orders. Each order has its own row with 20 Columns. I
sort the worksheet by the sales peoples initials which is located in Col. B.
I built a UserForm with a checkbox by each sales persons name. I want the
user to be able to select the sales persons checkbox and then the macro will
select the ranges and then print them. For example: If Sales Person AA & CC
Checkboxs were checked then the Macro would Select Ranges: all Rows w/
AA:Columns A thru K & all Rows with CC:Columns A thru K

Col.A B C D E F G H.... K
Sales Sales
# Person

AA
AA
BB
BB
CC
CC

I think then I could just write the macro to print Selection after the
ranges where selected.

Mike H

Select Multiple Ranges with Certain Data to Print
 
A lot simpler and it may meet your needs is to filter the data to show what
you require and then simply print. Only visible rows will be printed.

Mike

"RyanH" wrote:

I am a beginner with VBA and I am not sure how to begin with this. I have a
worksheet of product orders. Each order has its own row with 20 Columns. I
sort the worksheet by the sales peoples initials which is located in Col. B.
I built a UserForm with a checkbox by each sales persons name. I want the
user to be able to select the sales persons checkbox and then the macro will
select the ranges and then print them. For example: If Sales Person AA & CC
Checkboxs were checked then the Macro would Select Ranges: all Rows w/
AA:Columns A thru K & all Rows with CC:Columns A thru K

Col.A B C D E F G H.... K
Sales Sales
# Person

AA
AA
BB
BB
CC
CC

I think then I could just write the macro to print Selection after the
ranges where selected.


RyanH

Select Multiple Ranges with Certain Data to Print
 
I think this does make since after reading a little bit about the Advanced
Filter. But I do not know how to use it proporly. Can you show me some
code? Thanks for your help so far.

"Mike H" wrote:

A lot simpler and it may meet your needs is to filter the data to show what
you require and then simply print. Only visible rows will be printed.

Mike

"RyanH" wrote:

I am a beginner with VBA and I am not sure how to begin with this. I have a
worksheet of product orders. Each order has its own row with 20 Columns. I
sort the worksheet by the sales peoples initials which is located in Col. B.
I built a UserForm with a checkbox by each sales persons name. I want the
user to be able to select the sales persons checkbox and then the macro will
select the ranges and then print them. For example: If Sales Person AA & CC
Checkboxs were checked then the Macro would Select Ranges: all Rows w/
AA:Columns A thru K & all Rows with CC:Columns A thru K

Col.A B C D E F G H.... K
Sales Sales
# Person

AA
AA
BB
BB
CC
CC

I think then I could just write the macro to print Selection after the
ranges where selected.



All times are GMT +1. The time now is 05:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com