VBA uses the WorksheetFunction Object to access Excel's Functions
MIN() and MAX() are Excel Functions
Abs() is a VBA function that returns the Absolute value of a number
I am a lazy typist so I usually declare a short named variable to "hold" the Worksheet Function Object
Dim WsF as Object
'or
Dim WsFunc As Object
Set Wsf = Application.WorksheetFunction
'or
Set WsFunc = Application.WorksheetFunction
x = WsF.Max(3, 2, 6, 10) 'x = 10
y = WsFunc.Min(3, 2, 6, 10) 'y = 2
z = Abs(-5) 'z = 5
That way you can loop from the Min () of Lo and n to the Max() of Lo and n
You can decide which Sign to use
Dim Sign As Long 'Or as Integer, Integers use less memory, but Longs are more versatile
Sign = 1
If n * Lo < 0 Then Sign = -1
Finally multiply the result of the loop by the Sign.