Posted to microsoft.public.excel.programming
|
|
Vertical Page Break
Rob
Would it not be simpler to hide the columns?
--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
www.nickhodge.co.uk
"Rob" wrote in message
...
Hello Nick:
I accidently hit the "Enter" key before I typed in my message. That is
the
reason for the "and.... "
My question is how to insert a vertical page break in a macro. I have the
macro set now so that it finds "Grand Total" which is in the last row and
then goes up to "home "and that sets the print area. However, on some of
my
worksheets, I don't want to print the whole sheet so I would like to
insert a
vertical page break eliminating some of the columns.
Here is the code that I have so far:
Cells.Find(What:="Grand Total", After:=ActiveCell, LookIn:=xlFormulas,
LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=True).Activate
Range(Selection, Selection.Cells(1)).Select
ActiveSheet.PageSetup.PrintArea = ""
Range ("L1").select
ActiveSheet.VPageBreaks.Add Befo=ActiveCell
Everything works fine except the VPageBreak command. It doesn't do any
thing to the worksheet and I don't get an error message.
If you can, please help!!
rob
"Nick Hodge" wrote:
Rob
and.....
--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
www.nickhodge.co.uk
"Rob" wrote in message
...
|