To make your code easier to follow, try using a Select statement rather than nested Ifs.
This is your code converted with no refinements
Select Case LOPNum
Case Is > 0.5
PP = PP + 1
Case 0.4
P = P + 1
Case 0.3
P = P + 1
Case 0
W = W + 1
Case -0.3
M = M + 1
Case -0.4
M = M + 1
Case Is <= -0.6
MM = MM + 1
End Select
Without the rest of your code it isn't clear what you are actually trying to do
...., but the macro is adding what should be going on the P and M variable and is adding it on to the W variable.
I can't see how this is possible from the snippet provided.
You might be better to post a desensitised workbook with the relevant code included.
so that we can better understand your aims.
Bookmarks