How to set print area with some cells blank

Jeddo

Board Regular
Joined
Jan 26, 2019
Messages
50
Office Version
  1. 2019
Platform
  1. Windows
I need to set a variable print range in which some of the columns will have blank cells. The width of the print range is set; AZ6 to BC6, the length will vary depending on the data that varies. Columns AZ and BA will always have data in them, BB and BC may or may not have data in them.

I've used the following formula that will print to the end of the data, but can't figure out how to include BB and BC columns to the print range:

Range("AZ5", Range("BA8").End(xlDown)).PrintOut

Thanks for any help
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
How about
VBA Code:
Range("AZ5:BC" & Range("BA8").End(xlDown).Row).PrintOut
 
Upvote 0
I've tried that before and I get an error message. I believe I need to tell it to go two columns over after it reaches the last row with data, but I'm not familiar enough with the syntax.
 
Upvote 0

Forum statistics

Threads
1,215,477
Messages
6,125,030
Members
449,205
Latest member
Eggy66

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