T
tjb
When entering a specific number (or a list of numbers) in
a cell, I want another cell on the same sheet to gray
out. If the number is changed or removed I want the
other cells to go back to the way they were (not grayed
out). This code works with the exception of whenever
ANYTHING is changed on the sheet it goes back to
highlight Range("HOUR1, RATE1"). how do I get it to stop
doing that? Thanks! you all rock!
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("PDBA1").Value = "345" Then
Range("HOUR1, RATE1").Select
With Selection.Interior
.Pattern = xlGray25
End With
Range("ACCT_NUM1").Select
Exit Sub
Else
Range("HOUR1, RATE1").Select
With Selection.Interior
.Pattern = xlSolid
End With
Exit Sub
End If
End Sub
a cell, I want another cell on the same sheet to gray
out. If the number is changed or removed I want the
other cells to go back to the way they were (not grayed
out). This code works with the exception of whenever
ANYTHING is changed on the sheet it goes back to
highlight Range("HOUR1, RATE1"). how do I get it to stop
doing that? Thanks! you all rock!
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("PDBA1").Value = "345" Then
Range("HOUR1, RATE1").Select
With Selection.Interior
.Pattern = xlGray25
End With
Range("ACCT_NUM1").Select
Exit Sub
Else
Range("HOUR1, RATE1").Select
With Selection.Interior
.Pattern = xlSolid
End With
Exit Sub
End If
End Sub