set print area from selected range

G

Graham Whitehead

Hi, I have some code which selected a certain amount of columns depending on
whether they contain values or not. Once I have this range set and I select
it I want to set this as the print area. I am not quite sure how to do
this. for example I tried:

rngUnion.Select
ActiveSheet.PageSetup.PrintArea = ActiveCell.CurrentRegion.Address

But to no avail. Any help would be gratefully received.
 
A

Ardus Petus

The code I gave you sets the current selection as printarea.
Select something else!

Cheers,
 
Top