Este fórum está sendo desativado

Depois de 9 anos, este fórum será desativado. Mas calma.... estamos migrando para uma comunidade no DISCORD. Junte-se a nós.

ENTRAR PARA DISCORD

Tópicos relacionados a códigos VBA, gravação de macros, etc.
  • Avatar do usuário
#34852
Minhas considerações aos membros do fórum Guru do Excel
Fiz um medidor de tempo de execução - conforme demostro abaixo, gostaria que ao exibir o resultado através da msgbox viesse formatada da seguinte maneira: "HH:MM:SS" e como o tempo de execução, geralmente são menores de 1 minuto ficaria portanto assim: 00:00:34 por exemplo.
Espero ter feito entender,
Grato
Marcelo Adriano
Sub MedirTempoDeExecucao ()
Application.ScreenUpdating = False 'ACELERANDO CÓDIGOS
Dim TempoInicial As Double
Dim i As Integer
TempoInicial = Timer

For i = 1 To 1000
'Planilha1.Cells(i, 1).Select
Planilha1.Cells(i, 1).Value2 = i
Next i
MsgBox Round(Timer - TempoInicial, 4) & " Segundos...", , "Tempo de Execução..."
Application.ScreenUpdating = True
End Sub
#34853
Boa tarde.
Veja se te atende:
Código: Selecionar todos
Sub MedirTempoDeExecucao()
Application.ScreenUpdating = False 'ACELERANDO CÓDIGOS
Dim TempoInicial As Double
Dim i As Integer
TempoInicial = VBA.CDbl(VBA.Time)
For i = 1 To 10000

Planilha1.Cells(i, 1).Value2 = i
Next i

MsgBox WorksheetFunction.Text(VBA.CDbl(VBA.Time) - TempoInicial, "mm:ss")


Application.ScreenUpdating = True
End Sub
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]

Estamos migrando para uma comunidade no Discord