Function MultStr(SoBiNhan As String, SoNhan As String) As String
Dim ArrNhan()
Dim giu As Byte, sy2 As Byte, ketqua As String
Dim len1 As Byte, len2 As Byte, lenMax As Byte, soy As Byte
len1 = Len(SoBiNhan)
len2 = Len(SoNhan)
ReDim ArrNhan(1 To len2)
For y = 1 To len2
soy = Mid(SoNhan, y, 1)
ketqua = ""
For m = len1 To 1 Step -1
sy2 = Mid(SoBiNhan, m, 1) * soy + giu
ketqua = Right(sy2, 1) & ketqua
If sy2 > 9 Then giu = Left(sy2, 1) Else giu = 0
Next
If giu > 0 Then ketqua = giu & ketqua
If len2 - y > 0 Then ketqua = ketqua & String(len2 - y, "0")
If y = 1 Then
lenMax = Len(ketqua)
ElseIf Len(ketqua) < lenMax Then
ketqua = String(lenMax - Len(ketqua), "0") & ketqua
End If
ArrNhan(y) = ketqua
Next
ketqua = "": giu = 0
For y = lenMax To 1 Step -1
tong = 0
For m = len2 To 1 Step -1
tong = tong + CInt(Mid(ArrNhan(m), y, 1))
Next
tong = tong + giu
ketqua = Right(tong, 1) & ketqua
If tong > 9 Then giu = Left(tong, 1) Else giu = 0
Next
MultStr = " " & ketqua
End Function