inglewoodpete
Senior Member
From time to time I want to find the difference between two numbers. It doesn't matter which one is smaller or larger, just the difference.
I usually write code like this.
I could write a macro, of course, to hide the cumbersome code but is there a nifty one-line piece of code that I could use instead?
I usually write code like this.
Code:
[color=Blue]If [/color][color=Purple]w10 [/color][color=DarkCyan]> [/color][color=Purple]w11 [/color][color=Blue]Then
[/color][color=Purple]w12 [/color][color=DarkCyan]= [/color][color=Purple]w10 [/color][color=DarkCyan]- [/color][color=Purple]w11[/color]
[color=Blue]Else
[/color][color=Purple]w12 [/color][color=DarkCyan]= [/color][color=Purple]w11 [/color][color=DarkCyan]- [/color][color=Purple]w10 [/color][color=Green]'w12 will equal 0 if w10 & w11 are equal[/color]
[color=Blue]EndIf[/color]