Public Sub FormatCells()
Dim rowCount As Long, i As Integer, c As Variant
Dim rCell As Variant, jpSheet As Worksheet, str As String
Dim borderRange As Range, jpRange As Range
With Application
.Calculation = xlCalculationManual
.ScreenUpdating = False
.EnableEvents = False
End With
Set jpSheet = Worksheets("Job Planning")
Set jpRange = jpSheet.Range("D3:D35")
For Each rCell In jpRange
If Len(rCell) < 2 Then GoTo NextIteration
If Len(rCell.Address) = 5 Then
str = Right(rCell.Address, 2)
Else
str = Right(rCell.Address, 1)
End If
Set borderRange = jpSheet.Range(rCell, rCell.Offset(0, 2))
With rCell.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorLight2
.TintAndShade = 0.399975585192419
.PatternTintAndShade = 0
End With
With rCell.Offset(0, 1).Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 10092543
.TintAndShade = 0
.PatternTintAndShade = 0
End With
With rCell.Offset(0, 2).Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent4
.TintAndShade = 0.399975585192419
.PatternTintAndShade = 0
End With
With rCell.Offset(0, 1).Font
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
End With
For Each c In borderRange
With c.Borders
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlThin
End With
Next c
With borderRange.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlMedium
End With
With borderRange.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlMedium
End With
jpSheet.Shapes.Range(Array("CheckBox" & str)).Visible = msoTrue
NextIteration:
Next rCell
With Application
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub