Private Sub Worksheet_Activate()
Me.ScrollArea = "A1:P25"
ActiveWindow.ScrollColumn = 1
ActiveWindow.ScrollRow = 1
If Range("J4") = 1 Then
Range("J8").Select
ElseIf Range("J4") = 2 Then
Range("J10").Select
ElseIf Range("J4") = 3 Then
Range("J12").Select
ElseIf Range("J4") = 4 Then
Range("J14").Select
ElseIf Range("J4") = 5 Then
Range("J16").Select
End If
' GrossSalesCalc Macro
ActiveCell.FormulaR1C1 = _
"=SUM('STAGING AREA'!R[-5]C[-8],'STAGING AREA'!R[-3]C[-8],'STAGING AREA'!R[-2]C[-8],'STAGING AREA'!RC[-8])"
Range("J10").Select
ActiveCell.FormulaR1C1 = _
"=SUM('STAGING AREA'!R[-7]C[-6],'STAGING AREA'!R[-5]C[-6],'STAGING AREA'!R[-4]C[-6],'STAGING AREA'!R[-2]C[-6])"
Range("J12").Select
ActiveCell.FormulaR1C1 = _
"=SUM('STAGING AREA'!R[-9]C[-4],'STAGING AREA'!R[-7]C[-4],'STAGING AREA'!R[-6]C[-4],'STAGING AREA'!R[-4]C[-4])"
Range("J14").Select
ActiveCell.FormulaR1C1 = _
"=SUM('STAGING AREA'!R[-11]C[-2],'STAGING AREA'!R[-9]C[-2],'STAGING AREA'!R[-8]C[-2],'STAGING AREA'!R[-6]C[-2])"
Range("J16").Select
ActiveCell.FormulaR1C1 = _
"=SUM('STAGING AREA'!R[-13]C,'STAGING AREA'!R[-11]C,'STAGING AREA'!R[-10]C,'STAGING AREA'!R[-8]C)"
Range("J17").Select
End Sub
Private Sub CheckWeek()
'
If Range("J4").Value = 1 Then
Range("J8").Select
With Selection.Interior
.ColorIndex = 2
.Pattern = xlSolid
End With
Range("J10,J12,J14").Select
With Selection.Interior
.Pattern = xlGray50
.PatternColorIndex = 16
End With
Range("J8").Select
'
ElseIf Range("J4").Value = 2 Then
Range("J10").Select
With Selection.Interior
.ColorIndex = 2
.Pattern = xlSolid
End With
Range("J8,J12,J14").Select
With Selection.Interior
.ColorIndex = 2
.Pattern = xlGray50
.PatternColorIndex = 16
End With
Range("J10").Select
'
ElseIf Range("J4").Value = 3 Then
Range("J12").Select
With Selection.Interior
.ColorIndex = 2
.Pattern = xlSolid
End With
Range("J8,J10,J14").Select
With Selection.Interior
.ColorIndex = 2
.Pattern = xlGray50
.PatternColorIndex = 16
End With
Range("J12").Select
'
ElseIf Range("J4").Value = 4 Then
Range("J14").Select
With Selection.Interior
.ColorIndex = 2
.Pattern = xlSolid
End With
Range("J8,J10,J12").Select
With Selection.Interior
.ColorIndex = 2
.Pattern = xlGray50
.PatternColorIndex = 16
End With
Range("J14").Select
'
ElseIf Range("J4").Value = 5 Then
Range("J8,J10,J12,J14").Select
With Selection.Interior
.ColorIndex = 2
.Pattern = xlGray50
.PatternColorIndex = 16
End With
Range("J16").Select
With Selection.Interior
.ColorIndex = 2
.Pattern = xlSolid
End With
End If
End Sub
Private Sub DIMWEEK()
If Range("J4") = 5 Then
Call ShowWeek5
Else
Call NOShowWeek5
End If
End Sub
Private Sub ShowWeek5()
'
Range("J16").Select
With Selection.Interior
.ColorIndex = 2
.Pattern = xlGray50
.PatternColorIndex = 16
End With
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThick
.ColorIndex = 16
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThick
.ColorIndex = 16
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = 16
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlDouble
.Weight = xlThick
.ColorIndex = 16
End With
End Sub
Private Sub NOShowWeek5()
'
Range("J16").Select
With Selection
.Interior.ColorIndex = 15
.Interior.Pattern = xlSolid
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
End With
'
End Sub