Dynamic Print Range (+ Inserting a text box)

mharper90

Board Regular
Joined
May 28, 2013
Messages
117
Office Version
  1. 365
Platform
  1. 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!
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,223,885
Messages
6,175,187
Members
452,616
Latest member
intern444

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top