Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change the properties of a non selected cell?
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change the properties of a non selected cell?
just refer to the cells
target.offset(0,1).Interior.ColorIndex = 5 or cells(Target.row,"F").Interior.ColorIndex = 5 as examples. -- Regards, Tom Ogilvy "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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to change multiple cell comment properties? | Excel Discussion (Misc queries) | |||
change control properties according to a cell value | Excel Worksheet Functions | |||
Change Cell properties by Function | Excel Worksheet Functions | |||
Change active cell properties with command button | Excel Programming | |||
Change active cell properties with command button | Excel Programming |