If you can understand mathematical symbols, you can understand that code:


Sub dimSquare()
If xUp < 0 Then xUp = 0 'Ensure that xUp is not less than 0
If xUp > 600 Then xUp = 600 'Ensure that xUp is not more than 600
If yUp < 0 Then yUp = 0 'Ensure that xUp is not less than 0
If yUp > 480 Then yUp = 480 'Ensure that xUp is not more than 480

intW = Math.Abs(xUp - xDown) 'Set intW to xUp minus xDown ensuring that the value is positive (that's the ABS part)
intH = Math.Abs(yUp - yDown)


etc etc..