ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro needed for identify relations between rows. (https://www.excelbanter.com/excel-programming/454683-macro-needed-identify-relations-between-rows.html)

JS SL

Macro needed for identify relations between rows.
 
Hello,

Allways nice to figur something out that's looks impossible.
Perhaps a challange for somebody :)

I've got a sheet with several records and I have to check some relations.
It's looks to complex to do this by formulas so perhaps a code (which is to complex for me) can help me out.

In text it looks like;

The code should runs resulting in column AE;

For each row from record 2 till last;

for each row i

start rule;
If(AAi<4 then set 0 END CODE

otherwise;
If(and(AAi=4;CBi="") then set 2 END CODE

otherwise;
If field CBi containts neither "*K*" or "*Z*" then set 3 END CODE

otherwise;

if field CBi contains text "*K*"
then check in all other rows (except in row CBi !!) where the name in column AH (all rows!!) is the same as the name in field AGi, then check if in at least one of the rows of those identical ones, if in column CA also one times at least the text "*K*" is registered.

If it is then register "K-oke" and otherwise "K-noke"

otherwise;

if field CBi contains text "*Z*"
then check in all other rows (except in row CBi !!) where the name in column AH (all rows!!) is the same as the name in field AGi, then check if in at least one of the rows of those identical ones, if in column CA also one times at least the text "*Z*" is registered.

If it is then register "Z-oke" and otherwise "Z-noke"

So, that is looking complex.

Somebody like to solve. Please help !

regards, Johan



JS SL

Macro needed for identify relations between rows.
 
One misstake....

if field CBi contains text "*Z*"
then check in all other rows (except in row CBi !!) where the name in column AH (all rows!!) is the same as the name in field AGi, then check if in at least one of the rows of those identical ones, if in column CA also one times at least the text "*Z*" is registered.

Should be;
if field CBi contains text "*Z*"
then check in all other rows (except in row CBi !!) where the name in column AH (all rows!!) is the same as the name in field AGi, then check that in none of the rows of those identical ones, in column CA the text "*K*" is allowed.



All times are GMT +1. The time now is 09:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com