View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default Change the properties of a non selected cell?

Vincent,

Simply use the range object:

If YourCondition = Condition Then
Range("H1").Interior.ColorIndex = 3
Else
Range("H1").Interior.ColorIndex = xlNone
End If

HTH,
Bernie
MS Excel MVP

"Winshent" wrote in message
om...
i have some code which validates a row.. and compares two columns in
the row. The code is triggered from Worksheet_SelectionChange(ByVal
Target As Range) within the worksheet.

i want to be able to set the colours of the cells if they do not pass
validation.. how can i do this with selecting the actual cell?

Thanks

Vincent