Print Area to include text box
Hi Paul,
Am Tue, 6 Jan 2015 07:45:06 -0800 (PST) schrieb Paul Doucette:
My current print area is A1 to AG50. The text box sits on A17 to AG50. And it prints fine. However, sometimes the text box gets resized to a17 to AK75 or beyond, so I need the print area to increase so that part of the text box does not get cut off.
if your columns have standard width and the rows standard height you can
use:
Sub PrintArea()
Dim LRow As Long, LCol As Long
Dim LCell As Range
With ActiveSheet
LRow = .Shapes("textbox21").TopLeftCell.Row + _
.TextBox21.Height / 15
LCol = .Shapes("textbox21").TopLeftCell.Column + _
.TextBox21.Width / 60
Set LCell = .Cells(LRow, LCol)
.PageSetup.PrintArea = .Range(.Cells(1, 1), LCell).Address
End With
End Sub
Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
|