Public ii As Integer, i As Integer, kk As Integer, k As Integer, c As Integer, r As Integer
Private Sub MultiInput_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
Range(Cells(ii, kk), Cells(ii + r - 1, kk + c - 1)).Select
Dim diem, diemtam
diemtam = MultiInput.Value
If Len(diemtam) > 3 Then
MultiInput.Value = ""
Exit Sub
End If
If Len(diemtam) < 3 Then Exit Sub
If Len(diemtam) = 3 Then
Cells(i, k).Value = diemtam / 100
MultiInput.Value = ""
End If
k = k + 1
If k = kk + c Then
k = kk
i = i + 1
If i = ii + r Then
Cells(1, 1).Select
Unload Me
End If
End If
End Sub
Private Sub UserForm_Initialize()
i = ActiveCell.Row
ii = i
k = ActiveCell.Column
kk = k
c = Application.Selection.Columns.Count
r = Application.Selection.Rows.Count
End Sub