cortexnotion
Board Regular
- Joined
- Jan 22, 2020
- Messages
- 150
- Office Version
- 2013
- Platform
- Windows
Hi All
In need of your help with some VBA I can't get quite right!
The calculation is: (Column G+H) - (Column M+N). Then if the result is lower than -0.1 or greater than 0.1 apply the string value. What I have below is not generating the right results.
Any help appreciated, thanks
In need of your help with some VBA I can't get quite right!
The calculation is: (Column G+H) - (Column M+N). Then if the result is lower than -0.1 or greater than 0.1 apply the string value. What I have below is not generating the right results.
Any help appreciated, thanks
VBA Code:
For VRes = 4 To LR3
If WorksheetFunction.Sum((.Range("G" & VRes).Value + .Range("H" & VRes).Value) - (.Range("M" & VRes).Value - .Range("N" & VRes).Value)) < -0.1 Or _
WorksheetFunction.Sum((.Range("G" & VRes).Value + .Range("H" & VRes).Value) - (.Range("M" & VRes).Value - .Range("N" & VRes).Value)) > 0.1 Then
.Range("R" & VRes).Value = "Change Location to XYs " & .Range("G" & VRes).Value & ", " & .Range("H" & VRes).Value
Last edited: