Notifications
Clear all

Como fazer o cronometro atualizar sua planilha?

3 Posts
2 Usuários
0 Reactions
746 Visualizações
 Eric
(@eric)
Posts: 8
Active Member
Topic starter
 

Public Inicio As Date
Public Fim As Date
Public Comecou As Boolean

Sub Cronometro()
Inicio = Time
Fim = Time + TimeValue("00:15:00")
Teste
End Sub

Sub Teste()
Application.StatusBar = "Tempo restante: " & Format(Fim - Time, "hh:mm:ss")
If Time < Fim Then
Application.OnTime Now + TimeValue("00:00:01"), "Teste"
DoEvents
Else
MsgBox "Tempo esgotado"
Sheets("Plan1").Cells.Locked = True
ActiveSheet.Protect "Senha"
End If
End Sub

Então,até aqui está tudo bem,mas eu queria fazer isso:
Eu sei que tem um comando de atualizar a planilha,isso depois eu me viro,mas o que eu queria gente é saber como atualizar a planilha sempre quando o cronometro chegar a 00:00:05 por exemplo?
tipo:
Application.OnTime Now + TimeValue("00:00:01"), "Teste"
If timeValue ("00:00:05") then
Plan1.Atualizar
Muito obrigado mesmo!

 
Postado : 05/12/2013 2:57 pm
(@fernandofernandes)
Posts: 43750
Illustrious Member
 

Boa noite!!

Tente

Worksheets("Plan1").UsedRange.Columns("A:C").Calculate 
 
Postado : 05/12/2013 3:09 pm
(@fernandofernandes)
Posts: 43750
Illustrious Member
 

Boa noite Eric

Já temos alguns tópicos sobre o assunto, como este aqui:

viewtopic.php?f=10&t=1188

At.te

 
Postado : 05/12/2013 3:20 pm