Sumar diferentes textbox estando alguno de ellos vacío
Hola gracias por haberme ayudado más de una vez con tus somentarios.
Necesito sumar y restar varios textbox con horas, tengo una fórmula que lo consigue siempre y cuando estén todos ellos rellenos, pero si no me da un error... La fórmula es la siguiente
Private Sub textbox1_enter()
textbox1= TimeValue(textbox2) - TimeValue(textbox3) + TimeValue(textbox4) + TimeValue(textbox5)
End Sub
Y ESTOY PROVANDO ESTA OTRA
Private Sub HORES_TREBALLADES_enter()
If HORES_SUELTES = Empty Then
HORES_SUELTES = 0
End If
HORES_TREBALLADES = TimeValue(HORA_COMENÇAMENT) - TimeValue(HORA_FINAL) + TimeValue(HORES_SUELTES) + TimeValue(HORES_VIATGE)
End Sub
Pero no me funciona...
Te estoy muy agradecido de antemano...
Necesito sumar y restar varios textbox con horas, tengo una fórmula que lo consigue siempre y cuando estén todos ellos rellenos, pero si no me da un error... La fórmula es la siguiente
Private Sub textbox1_enter()
textbox1= TimeValue(textbox2) - TimeValue(textbox3) + TimeValue(textbox4) + TimeValue(textbox5)
End Sub
Y ESTOY PROVANDO ESTA OTRA
Private Sub HORES_TREBALLADES_enter()
If HORES_SUELTES = Empty Then
HORES_SUELTES = 0
End If
HORES_TREBALLADES = TimeValue(HORA_COMENÇAMENT) - TimeValue(HORA_FINAL) + TimeValue(HORES_SUELTES) + TimeValue(HORES_VIATGE)
End Sub
Pero no me funciona...
Te estoy muy agradecido de antemano...
Respuesta de denciso
1