Te anexo el código actualizado
Dim h1, h2
'
Private Sub guar_Click()
If nomb = "" Or nomb.ListIndex = -1 Then
MsgBox "Debes seleccionar tipo de doc."
nomb.SetFocus
Exit Sub
End If
u = h2.Range("C" & Rows.Count).End(xlUp).Row + 1
h2.Cells(u, "C") = nomb
h2.Cells(u, "D") = t1
h2.Cells(u, "E") = t2
h2.Cells(u, "F") = t3
h2.Cells(u, "G") = t4
h2.Cells(u, "H") = t5
h2.Cells(u, "I") = t6
h2.Cells(u, "J") = t7
h2.Cells(u, "K") = t8
h2.Cells(u, "L") = t9
h2.Cells(u, "M") = t10
h2.Cells(u, "N") = t11
h2.Cells(u, "O") = t12
MsgBox "Datos guardados"
Call limp_Click
End Sub
'
Private Sub nomb_Change()
If nomb.ListIndex = -1 Then Exit Sub
fila = nomb.ListIndex + 3
End Sub
'
Private Sub t4_Change()
fila = t4.ListIndex + 4
End Sub
Private Sub t5_Change()
'Después de capturar el Neto se calcula el iva
t6.Value = "" 'iva
t8.Value = "" 'total
If t5.Value = "" Then tx5 = 0 Else tx5 = Val(t5.Value)
t6.Value = Format(Val(tx5) * 0.19, "#,##0.00") 'iva
If t6.Value = "" Then tx6 = 0 Else tx6 = Val(t6.Value)
If t7.Value = "" Then tx7 = 0 Else tx7 = Val(t7.Value)
t8.Value = Format(tx5 + tx6 + tx7, "#,##0.00") 'total
End Sub
'
Private Sub t5_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
'Por.Dante Amor
'sólo números en Neto
If Not (KeyAscii >= 48 And KeyAscii <= 57) And Not KeyAscii = 46 Then
KeyAscii = 0
End If
End Sub
'
Private Sub t7_Change()
'Después de capturar el Específico se calcula el Total
t8.Value = "" 'total
If t5.Value = "" Then tx5 = 0 Else tx5 = Val(t5.Value)
If t6.Value = "" Then tx6 = 0 Else tx6 = Val(t6.Value)
If t7.Value = "" Then tx7 = 0 Else tx7 = Val(t7.Value)
t8.Value = Format(tx5 + tx6 + tx7, "#,##0.00")
End Sub
'
Private Sub t7_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
'Por.Dante Amor
'sólo números en Específico
If Not (KeyAscii >= 48 And KeyAscii <= 57) And Not KeyAscii = 46 Then
KeyAscii = 0
End If
End Sub
'
Private Sub t7_Exit(ByVal Cancel As MSForms.ReturnBoolean)
End Sub
'
Private Sub UserForm_Activate()
Dim h, i
Set h1 = Sheets("INGRESAR DATOS")
Set h2 = Sheets("TABLA DE DATOS")
If h1.AutoFilterMode Then h1.AutoFilterMode = False
For i = 3 To h1.Range("C" & Rows.Count).End(xlUp).Row
nomb.AddItem h1.Cells(i, "C")
Next
For i = 3 To h1.Range("D" & Rows.Count).End(xlUp).Row
t4.AddItem h1.Cells(i, "D")
Next
For i = 3 To h1.Range("E" & Rows.Count).End(xlUp).Row
t9.AddItem h1.Cells(i, "E")
Next
End Sub
'
Private Sub limp_Click()
nomb = ""
t5 = ""
t1 = ""
t2 = ""
t3 = ""
t4 = ""
t6 = ""
t7 = ""
t8 = ""
t9 = ""
t10 = ""
t11 = ""
t12 = ""
End Sub
'
Private Sub salir_Click()
End
End Sub
'S aludos. Dante Amor. Recuerda valorar la respuesta. G racias