Actualizar macros cada minuto que pasa.
Para Dande Amor
Ante todo un cordial saludo, tengo una macro que me diste y que trabaja perfectamente pero esta ves quisiera que el tiempo que se ejecuta lo haga en minutos y no en segundos; es decir que si pasa un minuto se actualice la macro o que se ejecute.
La macro que me diste es la siguiente.
Dim l1, h1
Sub Comenzar()
'Por.Dante Amor
Set l1 = ThisWorkbook
Set h1 = l1.Sheets("viajero")
If h1.[A4] = "" Then
MsgBox "No se puede ejecutar otra vez", vbCritical, "El reloj está en ejecución"
Exit Sub
End If
h1.[A4] = ""
h1.[A14] = "START"
Detener_Conteo
ActualizarHora
End Sub
Sub ActualizarHora()
'Por.Dante Amor
If h1.[A4] = "Fin" Then Exit Sub
h1.[B7] = h1.[B7] + TimeValue("00:00:01")
h1.[B4] = h1.[B4] + TimeValue("00:00:01")
h1.[B6] = h1.[B7] - TimeValue("00:00:01")
h1.[B5] = Time
Application.OnTime Now + TimeValue("00:00:01"), "ActualizarHora"
End Sub
Sub Detener()
'Por.Dante Amor
Set l1 = ThisWorkbook
Set h1 = l1.Sheets("viajero")
h1.[A4] = "Fin"
Call Inicio_Conteo
End Sub
Sub Iniciar()
'Por.Dante Amor
Call Detener
Set l1 = ThisWorkbook
Set h1 = l1.Sheets("viajero")
h1.[B4] = "00:00:00"
h1.[B9] = "00:00:00"
h1.[A14] = "INICIO"
h1.[B7] = Time
h1.[B1] = TimeValue(Now)
h1.[B6] = h1.[B7] - TimeValue("00:00:01")
Call Detener_Conteo
End Sub
Sub Inicio_Conteo()
'Por.Dante Amor
Set l1 = ThisWorkbook
Set h1 = l1.Sheets("viajero")
If h1.[A7] = "" Then
MsgBox "La secuencia de parada" & vbNewLine & " Está en ejecución", vbInformation, ""
Exit Sub
End If
h1.[A7] = ""
Parada
End Sub
Sub Detener_Conteo()
'Por.Dante Amor
Set l1 = ThisWorkbook
Set h1 = l1.Sheets("viajero")
h1.[A7] = "Fin"
End Sub
Sub Parada()
'Por.Dante Amor
If h1.[A7] = "Fin" Then Exit Sub
h1.[B9] = h1.[B9] + TimeValue("00:00:01")
h1.[B5] = Time
h1.[A14] = "PAUSA II"
Application.OnTime Now + TimeValue("00:00:01"), "Parada"
End Sub
Respuesta de William Kennedy
1
1 respuesta más de otro experto
Respuesta de Dante Amor
2


