.PrintTitleRows

D

Dr. M

Hello! I am having trouble with getting .PrintTitleRows to take a variable I
create that is equal to the row number I need. So instead of having:

.PrintTitleRows="$1:$1"

row_num = ActiveCell.Row
With ActiveSheet.PageSetup
.PrintTitleRows = row_num & row_num

only this does not work!! Any suggestions? Thanks in advance.
 
D

Dr. M

For those of you keeping track at home:

row_num = ActiveCell.Row
'make value printtitlerows will accept
header_row = "$" & row_num & ":$" & row_num

With ActiveSheet.PageSetup
.PrintTitleRows = header_row
End With
 
J

JE McGimpsey

No need for the "$"s or the With...End With.

Dim row_num As Long
row_Num = ActiveCell.Row
ActiveSheet.PageSetup.PrintTitleRows = row_num & ":" & row_num
 
Top