Can anyone solve this riddle for me? Why when I change the cell's value in $E$31 on the active sheet does it not continue to work in the "Shop Order" sheet?
I do not have much experience (yet) with VBA so please be gentle.
I really appreciate the wealth of resources that are found on this forum.
Thanks in advance.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$E$31" Then
With Sheets("Shop Order")
' The following code works with page 2 of the shop order worksheet specifically with System B.
'In this first if statement, it is assumed that system B will not be in use at all.
If Range("A73") = "" Then
Range("B71:O75").Borders.LineStyle = 0 'this comment clears out all boxes for system B
End If
'the following code creates one thick outline box because this carriage will have only one section.
If Range("A73") <> "" And Range("I46") >= 1 Then
Range("E72:N74").Borders.LineStyle = 0 'this comment clears out all boxes for system B after the first carriage box
Range("C72:D74").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlMedium
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlMedium
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlMedium
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlMedium
End With
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
End If
Bookmarks