exceladdict
Technical User
I have large excel 97 spreadsheet (Many formulas, Much formatting) that I have duplicated the Main Worksheet to about 25 other worksheets in the same workbook. (This gets utilized by about 6 other users via a shortcut to a template on the network). When I made the 25 identical copies it did not copy the print formating - i.e. Print Area, Fit to Print, Margins. Each worksheet only needs to print one page, but they all need to be identical.
What is wrong with the following code?
Is there an easier way to do this?
I selected the first duplicate worksheet and recorded this macro, thinking I can then just go to each sheet and run the macro. But, it takes very long to run such a simple macro (why?) even after taking out all of the unnecessary stuff I don't need to change. Then it crashes excel after the 3rd or 4th time I run it in this workbook?
Sub printsetup1()
ActiveWindow.LargeScroll Down:=1
ActiveWindow.SmallScroll ToRight:=6
ActiveWindow.SmallScroll Down:=24
Range("B1:T85"
.Select
Range("T85"
.Activate
ActiveSheet.PageSetup.PrintArea = "$B$1:$T$85"
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = "$B$1:$T$85"
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.25)
.RightMargin = Application.InchesToPoints(0.25)
.TopMargin = Application.InchesToPoints(0.25)
.BottomMargin = Application.InchesToPoints(0.25)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 1
Range("B2"
.Select
End Sub
I am new to this. Where am I going astray?
Thanks for you help.
Jim
P.S. I only need to set print area, have it fit to 1 x 1 pages, and set the margins, nothing else.
What is wrong with the following code?
Is there an easier way to do this?
I selected the first duplicate worksheet and recorded this macro, thinking I can then just go to each sheet and run the macro. But, it takes very long to run such a simple macro (why?) even after taking out all of the unnecessary stuff I don't need to change. Then it crashes excel after the 3rd or 4th time I run it in this workbook?
Sub printsetup1()
ActiveWindow.LargeScroll Down:=1
ActiveWindow.SmallScroll ToRight:=6
ActiveWindow.SmallScroll Down:=24
Range("B1:T85"
Range("T85"
ActiveSheet.PageSetup.PrintArea = "$B$1:$T$85"
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = "$B$1:$T$85"
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.25)
.RightMargin = Application.InchesToPoints(0.25)
.TopMargin = Application.InchesToPoints(0.25)
.BottomMargin = Application.InchesToPoints(0.25)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 1
Range("B2"
End Sub
I am new to this. Where am I going astray?
Thanks for you help.
Jim
P.S. I only need to set print area, have it fit to 1 x 1 pages, and set the margins, nothing else.