B
Brite
Hi,
I was wondering if there is a better way of running the following code
because as it is, it is really slowing up the macro i am creating. I will
need to run this code on approximately 20 sheets, but not all the sheets are
the same so i can't just select all the sheets at the same time and do it
that way. So the following set of code gets run whenever one of the 20 sheets
gets created.
Does anyone have any pointers?
thanks in advance!
Worksheets(1).Cells.Font.Name = "Arial Narrow"
Worksheets(1).Columns("A:A").ColumnWidth = 1.5
Worksheets(1).Columns("B:C").ColumnWidth = 16
Worksheets(1).Columns("D:O").ColumnWidth = 10
Worksheets(1).Columns("D:O").NumberFormat = "_(* #,##0_);_(* (#,##0);_(*
""-""_);_(@_)"
Worksheets(1).Rows("1:9").NumberFormat = "General"
With Worksheets(1).PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.4)
.RightMargin = Application.InchesToPoints(0.4)
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.5)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
'.PrintQuality = -3
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 80
'.PrintErrors = xlPrintErrorsDisplayed
End With
I was wondering if there is a better way of running the following code
because as it is, it is really slowing up the macro i am creating. I will
need to run this code on approximately 20 sheets, but not all the sheets are
the same so i can't just select all the sheets at the same time and do it
that way. So the following set of code gets run whenever one of the 20 sheets
gets created.
Does anyone have any pointers?
thanks in advance!
Worksheets(1).Cells.Font.Name = "Arial Narrow"
Worksheets(1).Columns("A:A").ColumnWidth = 1.5
Worksheets(1).Columns("B:C").ColumnWidth = 16
Worksheets(1).Columns("D:O").ColumnWidth = 10
Worksheets(1).Columns("D:O").NumberFormat = "_(* #,##0_);_(* (#,##0);_(*
""-""_);_(@_)"
Worksheets(1).Rows("1:9").NumberFormat = "General"
With Worksheets(1).PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.4)
.RightMargin = Application.InchesToPoints(0.4)
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.5)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
'.PrintQuality = -3
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 80
'.PrintErrors = xlPrintErrorsDisplayed
End With