#1   Report Post  
Dr. M
 
Posts: n/a
Default .PrintTitleRows

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.

--
Dr. M
  #2   Report Post  
Dr. M
 
Posts: n/a
Default

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

--
Dr. M


"Dr. M" wrote:

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.

--
Dr. M

  #3   Report Post  
JE McGimpsey
 
Posts: n/a
Default

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


In article ,
"Dr. M" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"