Print Using VBA

longytravel

Board Regular
Joined
Aug 2, 2011
Messages
68
Afternoon,

I have a sheet that is populated by a userform.

All works great thanks to some help from you guys. The data runs from Column B : I (starting at B2)

I have a bit of VBA that sizes the columns so they look perfect on the screen

I would now like to produce something that prints it in the most 'visually friendly way'

Each row of detail could potentially have quite a lot of detail, there could be up to 20 rows at any one time so it will spill onto more than one sheet - maybe quite a few sheets

What code would be suitable to keep it easy to read and not waste loads of paper.

All the formatting on screen is fine

I guess as a minimum i wouldnt want to split any rows over two sheets i.e if a row is at the bottom of the page and would spill onto the next sheet the code jsut starts the row on the next sheet from the start - can that be done??

Thanks as ever!
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Afternoon,

I have a sheet that is populated by a userform.

All works great thanks to some help from you guys. The data runs from Column B : I (starting at B2)

I have a bit of VBA that sizes the columns so they look perfect on the screen

I would now like to produce something that prints it in the most 'visually friendly way'

Each row of detail could potentially have quite a lot of detail, there could be up to 20 rows at any one time so it will spill onto more than one sheet - maybe quite a few sheets

What code would be suitable to keep it easy to read and not waste loads of paper.

All the formatting on screen is fine

I guess as a minimum i wouldnt want to split any rows over two sheets i.e if a row is at the bottom of the page and would spill onto the next sheet the code jsut starts the row on the next sheet from the start - can that be done??

Thanks as ever!

I always like the range way.

Code:
range("B2:I20").printout

but you can do the same for an active sheet (only problem is its the whole sheet where the above is what ever you want)
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,280
Members
452,902
Latest member
Knuddeluff

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