Adding IF function

sjfir

New Member
Joined
Aug 24, 2009
Messages
47
Hi, I have the following macro which is used to print off a different number of copies for different audiences, the problem I have is that if the sheets have data they will print off any way and I was wondering how I would add an IF statement to check for example in sheet B whether cell B44 was 0 and if zero it would not then print that sheet and so on. Thanks

Sheets(Array("A", "B", "C", _
"D", "E")).Select
Sheets("A").Activate
ActiveWindow.SelectedSheets.PrintOut Copies:=2, Collate:=True
Sheets(Array("A", "C", "D", _
"E", "F")).Select
Sheets("C").Activate
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets("G").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("A").Select
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Hi

I tried that and all I am getting is a compile error around the word Sheets, any help please.
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,730
Members
452,939
Latest member
WCrawford

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