View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
jasminesy jasminesy is offline
external usenet poster
 
Posts: 18
Default user input "Rows to Repeat"

let me expand...it says "Unable to set the PrintTitleRows property of the
page setup class"....

"jasminesy" wrote:

Still getting error...am I trying to do something I shouldn't here is the
beginning of my sub...this is the only area I'm having a problem with...even
setting the: Dim myrows as Range isn't working...


Sub props()
Titles = MsgBox("Do any rows need to repeat?", vbYesNo, "Repeating Titles")
If Titles = vbYes Then
Set myrows = Application.InputBox(prompt:="Select Rows", Type:=8)
Set myrows = myrows.EntireRow
With ActiveSheet.PageSetup
.PrintTitleRows = myrows
.PrintTitleColumns = ""
End With
Else: With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
End If


"Tom Ogilvy" wrote:

Dim rng as Range
set rng = Nothing
On error resume next
set rng = Application.Inputbox("Select rows to repreat at top",type:=8)
On Error goto 0
if not rng is nothing then
' rows were selected
set rng = rng.EntireRow
' set the rows to repeat at top
end if

--
Regards,
Tom Ogilvy

"jasminesy" wrote:

I'm writing a macro to create a formatted page that will print to my
specifications...the only part I can't figure out is:

When I ask the user if they need rows to repeat at top, how can they select
them manually and my macro still read it so that it can adjust the page setup
automatically?

Appreciate any help.