I have a form where the data will vary depending on the physician selected.
I want to use VBA to control the printing of this form. It works fine if I hard code the SET Print Range. However I want to be able to expand and contract the Print Range.
The Row Titles from row 1 through 7. The data lines start at Row 8 and go to Col R.
Here is my code to control the Set Print Range.
.PrintTitleRows = "$1:$7"
.PrintTitleColumns = ""
Application.PrintCommunication = True
ActiveSheet.PageSetup.PrintArea = "PrintArea"
Application.PrintCommunication = False
I tried to set up a Named Range with the formula:
Offset('Physician Report'!$A$7,0,0,counta('Physician Report'!$A$8:$A$200), Counta('Physician Report1!$A$8:$R:$200))
This gave me just the headers.