Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Validation check
hi all
i have created a very long drop list (25 values) for validating all cells on column E, the same list appears on all the cells on the columns G,I,K,M... and so forth. is there a code that can check if in a row 2 or more cells in the relevant columns contain the same Value. and in such a case, for exmple change the color of the cells with the same values. thanks guy |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Validation check
Is there a possibilty that columns that are not checked (F, H, J, etc) will
have duplicate values as well? If not, the problem is fairly easy. If they could, then it becomes more complex. this assumes the simpler case: Sub FindDupes() Dim cell as range, rng as Range Dim cell1 as Range, rng1 as Range set rng = Range("E2",Cells(rows.count,"E").End(xlup)) for each cell in rng set rng1 = cell.resize(1,20) '<== change the 20 for each cell1 in rng1 if cell1.column mod 2 = 1 then if application.countif(rng1,cell1) 1 then cell1.Interior.ColorIndex = 3 else cell1.Interior.ColorIndex = xlNone end if end if Next cell1 Next cell End sub Change the 20 to reflect the number of columns to check. -- Regards, Tom Ogilvy "Guye" wrote: hi all i have created a very long drop list (25 values) for validating all cells on column E, the same list appears on all the cells on the columns G,I,K,M... and so forth. is there a code that can check if in a row 2 or more cells in the relevant columns contain the same Value. and in such a case, for exmple change the color of the cells with the same values. thanks guy |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Validation check
hi,
it gives me the following bug Unable to set the Colorindex property of interior class thanks |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Validation check
hi,
its the simple case regards, guy |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Validation check
It ran like a champ for me against dummy data I would consider consistent
with your explanation. Hopefully you haven't done something silly like protecting your worksheet. -- Regards, Tom Ogilvy "Guye" wrote: hi, it gives me the following bug Unable to set the Colorindex property of interior class thanks |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Validation check
hi
its true, i have protected it. when i unprotected it, it worked. regards guy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Check Box and Validation of a cell | Excel Discussion (Misc queries) | |||
VB Data Validation check | Excel Discussion (Misc queries) | |||
How to check whether Cell has Validation? | Excel Programming | |||
Check validation on SelectionChange | Excel Programming | |||
Problem with validation check! | Excel Worksheet Functions |