Hi,
I wonder whether someone may be able to help me please.
I am using the code below to automatically change the cell background colour once a value has been entered.
Private Sub Worksheet_Change (ByVal as Target As Range)
Set MyRange = Range ("D4:O25")
For Each Cell In MyRange
If Cell.Value >=1 Then
Cell.Interior.ColorIndex=35
End If
If Cell. Value < 1 Then
Cell.Interiot.ColorIndex=XLNone
End If
Next
End Sub
This works fine, but what I would like it to do, is for it to not only look and see whether a value has been entered into the cell, but also to look in the Range C4:C25 and look for the name Chris, so basically it will only shade in the cell if it finds "Chris" in my column C Range and a value in the applicable cell.
I can get this to work by adding another If statement into the first but it then shades the cells in column C as well.
I'm pretty new to Vb and I'm sure it's quite simple, but I just wondered whether someone could point me in the right direction please.
Many thanks
Chris
I wonder whether someone may be able to help me please.
I am using the code below to automatically change the cell background colour once a value has been entered.
Private Sub Worksheet_Change (ByVal as Target As Range)
Set MyRange = Range ("D4:O25")
For Each Cell In MyRange
If Cell.Value >=1 Then
Cell.Interior.ColorIndex=35
End If
If Cell. Value < 1 Then
Cell.Interiot.ColorIndex=XLNone
End If
Next
End Sub
This works fine, but what I would like it to do, is for it to not only look and see whether a value has been entered into the cell, but also to look in the Range C4:C25 and look for the name Chris, so basically it will only shade in the cell if it finds "Chris" in my column C Range and a value in the applicable cell.
I can get this to work by adding another If statement into the first but it then shades the cells in column C as well.
I'm pretty new to Vb and I'm sure it's quite simple, but I just wondered whether someone could point me in the right direction please.
Many thanks
Chris