View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
viewmaster[_4_] viewmaster[_4_] is offline
external usenet poster
 
Posts: 1
Default Changing cell colour in Range


Hi all!

I got some help with this bit of code, but i wanted to modify it a
little. I haven't had any luck. I was hoping to check the values of a
couple of cells rather than just "G14:S14" (eg: G13:S13...G17:S17) This
bit of code works, however i'm not sure how to get it to read each of
the rows. The conditions are the same for each row. Any help would be
greatly appreciated!! Thanks


Private Sub Worksheet_Change(ByVal Target As Range)
Dim bOk as Boolean, cell as Range
Dim icolor As Integer
If Not Intersect(Target, Range("G14:S14")) Is Nothing Then
bOk = True

for each cell in Range("G14:S14")
if not isdate(cell.Value) then
if cell.Text < "N/A" then
bOK = False
exit for
end if
end if
Next
If bOk then
Range("F14").Interior.ColorIndex = 4
Else
Range("F14").Interior.ColorIndex = 0
End If
End if

End Sub


--
viewmaster
------------------------------------------------------------------------
viewmaster's Profile: http://www.excelforum.com/member.php...o&userid=32094
View this thread: http://www.excelforum.com/showthread...hreadid=519227