totalnatal
New Member
- Joined
- Jun 9, 2010
- Messages
- 33
Hello,
I have the following lines of code which occur if a certain cell in the worksheet equals a certain value . However, the problem is if that cell in question does not equal that value then the changes done before when the lines were run have not been taken out and remain. Is there anyway to do something like . If Cell(X:X) = Criteria Then Change those cells format, Else keep original formatting. Thanks!
I have the following lines of code which occur if a certain cell in the worksheet equals a certain value . However, the problem is if that cell in question does not equal that value then the changes done before when the lines were run have not been taken out and remain. Is there anyway to do something like . If Cell(X:X) = Criteria Then Change those cells format, Else keep original formatting. Thanks!
Code:
If Worksheets("Settings").Cells(4, 2).Value = "Outperformance Note" Then
With Worksheets("Settings").Range("a8:b13").Borders(xlDiagonalDown)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
With Worksheets("Settings").Range("a8:b14").Borders(xlDiagonalUp)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End With
End If