Function SoTim(A96 As Integer, A60 As Integer, A32 As Integer, SoDuA As Integer, _
S123 As Integer, Optional SoDu2 As Integer = 0) As Integer
Dim W As Long, Tmp1 As Long, Tmp2 As Long, Tmp3 As Integer, Tmr As Double, Dm As Integer
W = S123 - 1
Do
W = W + 1: If W > 65500 Then Exit Do
If (W - SoDu2) / S123 = (W - SoDu2) \ S123 Then
If (W - SoDuA) \ A96 = (W - SoDuA) / A96 Then
If (W - SoDuA) \ A60 = (W - SoDuA) / A60 Then
If (W - SoDuA) \ A32 = (W - SoDuA) / A32 Then
SoTim = W: Exit Function
End If
End If
End If
End If
Loop
End Function