RE:Aviso de fin de tiempo
Hola.
Yo haría lo siguiente.
Declaras esta variable
Dim HoraInicio As Variant
Al iniciar el programa le das el valor de la hora en que se inicia.
Private Sub Form_Load()
HoraInicio = Format(Now, "hh:mm:ss")
End Sub
Luego pones un Timer con el Interval a 1000 para hacer un reloj con este código.
Private Sub Timer1_Timer()
Dim t1 As Variant, t2 As Variant, t3 As Variant, t4 As Variant, t5 As Variant
t1 = Format(TimeValue(Now) - TimeValue(t0), "hh:mm:ss") 'resta el tiempo empleado en aceptar el mensaje
t2 = "00:00:05" ' primer aviso
t3 = "00:00:10" ' segundo aviso
t4 = "00:00:15" ' tercer aviso y final
If t1 = Format(TimeValue(HoraInicio) + TimeValue(t2), "hh:mm:ss") Then
t5 = t1
MsgBox "Faltan 10 segundos"
t0 = Format(TimeValue(Now) - TimeValue(t5), "hh:mm:ss") ' tiempo que tarda en aceptar
Else
If t1 = Format(TimeValue(HoraInicio) + TimeValue(t3), "hh:mm:ss") Then
t5 = t1
MsgBox "Faltan 5 segundos"
t0 = Format(TimeValue(Now) - TimeValue(t5), "hh:mm:ss")
Else
If t1 = Format(TimeValue(HoraInicio) + TimeValue(t4), "hh:mm:ss") Then
MsgBox "Tiempo agotado"
End
End If
End If
End If
El tiempo que se tarda en aceptar el mesaje lo resta porque en periodos si le vuelve a dar la hora actual puede que ya se pase del segundo o tercer aviso.
Espero que te ayude en algo
Saludos