PMRetired2012
Board Regular
- Joined
- Aug 6, 2019
- Messages
- 123
I have a code that i need to modify so that it wont print all 12 months.
The problem is i have data enterd into 8 months of this year but with the code i have it prints all 12 months even tho there isnt data in the last 3 months of the year.
Here is the code i have and it needs to be changed to where it only prints the pages that has something in cell A3 of each month and i want to print whole page. This code is attached to a userform that lets me select how and what i want printed.
CODE:
'AllMonthsPageOne
If OptionButton2 = True Then
Sheets(Array("JANUARY", "FEBUARY", "MARCH", "APRIL", "MAY", "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER")).Select
Sheets("JANUARY").Activate
Range("A1:R54").Select
'PrintPreview
If CheckBox3.Value = True Then ExecuteExcel4Macro "PRINT(1,,,1,,TRUE,,,,,,1,,,TRUE,,FALSE)"
'Print
If CheckBox3.Value = False Then ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,1,,,TRUE,,FALSE)"
Thanks for any help!
The problem is i have data enterd into 8 months of this year but with the code i have it prints all 12 months even tho there isnt data in the last 3 months of the year.
Here is the code i have and it needs to be changed to where it only prints the pages that has something in cell A3 of each month and i want to print whole page. This code is attached to a userform that lets me select how and what i want printed.
CODE:
'AllMonthsPageOne
If OptionButton2 = True Then
Sheets(Array("JANUARY", "FEBUARY", "MARCH", "APRIL", "MAY", "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER")).Select
Sheets("JANUARY").Activate
Range("A1:R54").Select
'PrintPreview
If CheckBox3.Value = True Then ExecuteExcel4Macro "PRINT(1,,,1,,TRUE,,,,,,1,,,TRUE,,FALSE)"
If CheckBox3.Value = False Then ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,1,,,TRUE,,FALSE)"
Thanks for any help!