I’ve got the following IF-conditions set up:
If Range("D" & x) + Range("D" & z) = 0 = True And (Range("G" & x) = Range("G" & z)) = True And (IsEmpty(Range("A" & x)) = False) = True And (IsEmpty(Range("C" & x)) = False) = True Then
[guts]
End if
I’ve inserted all of the (condition) = True in order to be able to evaluate each individual condition while debugging, and ALL of them return TRUE = TRUE. And yet it doesn’t execute the guts of the boolean. It just doesn’t make sense to me, but hopefully one of you can see what is wrong with it. I created a test sheet to run the macro on, containing only a few rows of data that I know should return TRUE on all of the conditions, but it doesn’t work. I have a feeling that it is a painfully obvious error.
You can download a sample including some data here: http://www.mediafire.com/view/?rm299bttfsp1v01
Reformatted this and made a pastable example of it:
It works for me, if A1=12 and C1=12 (e.g.)
But this is how I would write this:
Edit
You can test this easily, using this code:
Paste if after
For Z = 8 To 16.It does not resolve to true, that is why you are not getting the guts 😉