Dynamic Print Range (+ Inserting a text box)

mharper90

Board Regular
Joined
May 28, 2013
Messages
111
Office Version
365
Platform
MacOS
I'm trying to create a dynamic print range from A2, to F2, and extending to the last line with text. I've tried this code, and just can't seem to get it.

Sub printFigure2()

Dim ws2 As Worksheet
Set ws2 = Worksheets("Figure 2-2")

With ws2​
.ResetAllPageBreaks
With .PageSetup​
.PrintArea = "Offset('Figure 2-2'!$A$2,,,Count('Figure 2-2'!A2:A),)"
.PaperSize = xlPaperLetter
.Orientation = xlPortrait
.FitToPagesTall = False
.FitToPagesWide = 1
.CenterFooter = "Page &P of &N"​
End With
.PrintPreview​
End With

End Sub


This was my first bridge to cross, but in the end, I actually want to insert a text box (with basically a signature line inside of it) 2 rows below the last row of text, and also have the text box incorporated in the dynamic print area. If you know how to help me with the print area, maybe you also know how to help me with the text box? Thanks in advance!
 

Some videos you may like

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Watch MrExcel Video

Forum statistics

Threads
1,099,468
Messages
5,468,808
Members
406,611
Latest member
hanman453

This Week's Hot Topics

Top