Hi all!
I am struggling with macro that checks offset of a cell. I am able to build range and everything, but I have problem with IF AND condition.
So looking at mini sheet:
Macro button in column I
Column F - from row 3 to LastRow - input from user
Range N3:T & LastRow - exported data
If condition:
Checks value from column F in column N.
If column O has "X" and column S is not empty and column T contains anything except "X" (can be empty as well), then count how many values meet these conditions and display number in cell J2 with word "found". Then change cell color in column F to red.
Values C, D and E meet these conditions so they are red.
I am struggling with macro that checks offset of a cell. I am able to build range and everything, but I have problem with IF AND condition.
So looking at mini sheet:
Macro button in column I
Column F - from row 3 to LastRow - input from user
Range N3:T & LastRow - exported data
If condition:
Checks value from column F in column N.
If column O has "X" and column S is not empty and column T contains anything except "X" (can be empty as well), then count how many values meet these conditions and display number in cell J2 with word "found". Then change cell color in column F to red.
Values C, D and E meet these conditions so they are red.
Book1 | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | |||
1 | |||||||||||||||||||
2 | Macro button | 3 found | Status | Parent | Status | ||||||||||||||
3 | A | A | X | AA | X | ||||||||||||||
4 | B | B | X | BB | X | ||||||||||||||
5 | C | C | X | CC | |||||||||||||||
6 | D | D | X | DD | |||||||||||||||
7 | E | E | X | EE | |||||||||||||||
8 | F | F | FF | ||||||||||||||||
9 | G | G | GG | ||||||||||||||||
10 | H | H | |||||||||||||||||
11 | I | I | |||||||||||||||||
12 | J | J | |||||||||||||||||
13 | K | K | KK | ||||||||||||||||
14 | L | L | LL | ||||||||||||||||
15 | |||||||||||||||||||
Sheet1 |