View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student
 
Posts: n/a
Default printing Union of Ranges

Also make the range contiguous.
--
Gary''s Student


"Gary''s Student" wrote:

Hide cols E & F
--
Gary''s Student


"anny" wrote:

Hello

I can't figure out why this doesn't work. It gives a PrintPreview of my
whole table, A1:N27. What I want is a table with 6 adjacent columns A B C D
G H.

Dim Range1 As Range
Dim Range2 As Range
Dim RangeCombined As Range
Set Range1 = Range("$A$1:$D$27")
Set Range2 = Range("$G$1:$H$27")
Set RangeCombined = Union(Range1, Range2)

ActiveSheet.PageSetup.PrintArea = RangeCombined
ActiveSheet.PrintOut preview:=True

thks
anny