PDA

View Full Version : Sleeper: Landscape if 2 pages wide?



Djblois
12-20-2006, 08:51 AM
I haven't been here in a while because I haven't written code in a while. Well now I am back to it but a little rusty. So please bare with me. I need to get my feet wet. Is there a way to say if my spreadsheet is wider than one page then switch to landscape and if not stay portrait.

Thank you,
Daniel

lucas
12-20-2006, 09:56 AM
I may be wrong Daniel but if your looking for some kind of auto-detect then I would guess the answer is no.....maybe brighter folks have a different opinion.

austenr
12-20-2006, 09:57 AM
This will switch the print to landscape.



Sub chgprintout()
With ActiveSheet.PageSetup
.Orientation = xlLandscape
End With
End Sub


Not sure on how to determine if its wider than one page.

austenr
12-20-2006, 10:01 AM
Excel's Range object has a CurrentRegion property, which returns another
Range object representing contiguous data. This is a helpful way to find
where a sheet extends to.