Vertical Page Break
Rob
and..... -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England DTHIS www.nickhodge.co.uk "Rob" wrote in message ... |
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 ... |
All times are GMT +1. The time now is 03:14 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com