Function ZDGYS(ByVal m As Long, ByVal n As Long) As Long 'Great Common Divisor
ZDGYS = m
While n > 0
m = ZDGYS Mod n
ZDGYS = n
n = m
Wend
End Function
Function ZXGBS(ByVal m As Long, ByVal n As Long) As Long 'Least Common Multiple
ZXGBS = m * n / ZDGYS(m, n)
End Function