Contador de Tempo xls xlsx

Embed Size (px)

DESCRIPTION

Contador de tempo para excel

Citation preview

Dim InicioSistema, FimSistemaDim CartaoAtual As LongInicioSistema = Now()Range("q35").Value = InicioSistema' Apaga rea Base e Monte Carlo' CORTE QUANT CART - COL 1 - COL X - COL 2 - COL X+2 Sheets("Monte Carlo").Select Range("x26").Select ActiveCell.FormulaR1C1 = Jogo(1) & Jogo(2) & Jogo(3) & Jogo(4) & Jogo(5) & Jogo(6) & Jogo(7) & Jogo(8) & Jogo(9) & Jogo(10) & Jogo(11) & Jogo(12) & Jogo(13) & Jogo(14) & Jogo(15) Calculate CartaoAtual = CartaoAtual + 1 Range("q34").Value = CartaoAtual 'calcular o tempo de execucao Select Case CartaoAtual Case Is = 1000 FimSistema = Now() MsgBox "Cartao atual: " & CartaoAtual & vbCrLf & "Cartes encontrados: " & Contador & vbCrLf & " Executado em " & (DateDiff("s", InicioSistema, FimSistema)) & "Segundos" ' MsgBox "Cartao atual: " & CartaoAtual & vbCrLf & "Cartes encontrados: " & Contador & vbCrLf & " Executado em " & (DateDiff("n", InicioSistema, FimSistema)) & "Minutos" Case Is = 2000 FimSistema = Now()Range("q37").Value = InicioSistema MsgBox "Cartao atual: " & CartaoAtual & vbCrLf & "Cartes encontrados: " & Contador & vbCrLf & " Executado em " & (DateDiff("s", InicioSistema, FimSistema)) & "Segundo" FimSistema = Now()Application.Calculation = xlCalculationAutomaticRange("q36").Value = FimSistemaActiveWorkbook.SaveMsgBox "Executado em " & (DateDiff("n", InicioSistema, FimSistema)) & "Minutos"''Application.Visible = True End Select