Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default macro to change repeat row/column print setting

Hi. I need to set the repeat rows/columns option in page
setup for a set of workbooks I am printing. I tried
recording a macro to do this but it does not change
anything. It did loop through the sheets but no changes
were made. There are several page setup settings already
so I would like to not have to redo those. And I really
only need to select one sheet at a time. My computer at
work is slow and likes to crash if I ask very much of it.

TIA


Todd






Sub PrintRows()
' Keyboard Shortcut: Ctrl+u

For Each WS In Worksheets
With ActiveSheet.PageSetup
.PrintTitleRows = "$7:$10"
.PrintTitleColumns = "$A:$A"
End With
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 100
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = True
.Zoom = 100
End With
Next
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default macro to change repeat row/column print setting

Sub PrintRows()

For Each WS In Worksheets
With ActiveSheet.PageSetup
.PrintTitleRows = "$7:$10"
.PrintTitleColumns = "$A:$A"
End With
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftHeader = ""
End With
Next
End Sub


for each ws in activeworkbook.worksheets

BUT you dont seem to use the ws object at all, instead you use the
activesheet, but you forget to activate each ws as you go along


inside your loop you could do 2 things:
'1:
ws.activate
with activesheet.pagesetup

'2:
with ws.pagesetup

I'd always pick the last method..


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Todd" wrote:

Hi. I need to set the repeat rows/columns option in page
setup for a set of workbooks I am printing. I tried
recording a macro to do this but it does not change
anything. It did loop through the sheets but no changes
were made. There are several page setup settings already
so I would like to not have to redo those. And I really
only need to select one sheet at a time. My computer at
work is slow and likes to crash if I ask very much of it.

TIA


Todd





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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change print titles (rows to repeat at top) on subsequent pages Eric Excel Discussion (Misc queries) 3 April 4th 23 10:12 AM
macro to repeat non contiguous rows at top in Print jwmbem Excel Discussion (Misc queries) 2 March 8th 08 07:50 PM
Setting different rows to repeat for print. katie Excel Discussion (Misc queries) 2 October 19th 07 05:43 PM
How I can print full text bigger than column, in repeat column Prince Excel Discussion (Misc queries) 0 August 11th 05 07:28 PM
Setting up a macro to print? Abi Excel Worksheet Functions 0 January 10th 05 08:09 PM


All times are GMT +1. The time now is 06:59 PM.

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"