Hello,
I have no experience with VBA so need help in figuring this out. I have the following code:
Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #3 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer
Sub Overtime()
'
' Overtime Macro
' Calculate Overtime
'
'
Range("A1:R1").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Columns("O:O").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("O3").Select
ActiveCell.FormulaR1C1 = "Overtime"
With ActiveCell.Characters(Start:=1, Length:=8).Font
.Name = "Calibri"
.FontStyle = "Regular"
.Size = 11
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.ThemeFont = xlThemeFontMinor
End With
Range("O4").Select
ActiveCell.FormulaR1C1 = _
"=IF(RC13<0.00001,"""",IF(RC13>0.6458333,RC13-0.6458333,""""))"
Range("O4").Select
Selection.AutoFill Destination:=Range("O4:O19"), Type:=xlFillDefault
Range("O4:O19").Select
Range("O20").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-16]C:R[-1]C)"
Range("O21").Select
ActiveWindow.SmallScroll ToRight:=4
Range("A1:S1").Select
Range("S1").Activate
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
ActiveWindow.LargeScroll ToRight:=-1
Range("A20").Select
End Sub
I want to be able to have it repeat the sheet formatting and calculation across multiple worksheets...how do i do that?
Bookmarks