Afficher compte à rebours d'une macro

Bonjour à tous,

J'ai créé une macro en boucle qui va récupérer un fichier HTML (provenant de SAP).

Une fois ces données récupérées, elles sont affichées et des mise en forme conditionelles sont appliquées.

J'ai également créé une boucle sur cette macro avec "Excel.Application.OnTime Now + TimeValue("00:00:15"), "actualisation""

La macro tourne donc en boucle toute les 15 secondes.

Ce que je souhaite c'est afficher le chrono de cette macro ou alors afficher un décompte pour savoir quand va s'actualiser la macro.

J'ai farfouiller sur le forum, j'ai tester pas mal de chose mais je n'arrive pas à obtenir ce que je veux.

Merci à ceux qui pourront m'aider.

Cdt

Alexandre

Voici mon code :

Sub actualisation()
'
' actualisation Macro
'

'
Excel.Application.OnTime Now + TimeValue("00:00:15"), "actualisation"
    Range("A1").Select
    ActiveWorkbook.RefreshAll
    Range("A2:j36").Select
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
    With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeTop)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlInsideVertical)
        .LineStyle = xlDot
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlInsideHorizontal)
        .LineStyle = xlDot
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection
        .HorizontalAlignment = xlGeneral
        .VerticalAlignment = xlCenter
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    With Selection
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlCenter
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    With Selection
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlBottom
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    With Selection
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlCenter
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    With Selection
    Range("A2:J36").Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteColumnWidths, Operation:=xlNone, _
        SkipBlanks:=False, Transpose:=False
    ActiveSheet.Paste
    Application.CutCopyMode = False
    Range("A1").Select
    End With
    End Sub

Bjr,

si tu es un peu familier avec VBA, pars de ceci et adapte le

74compteur.xlsm (18.57 Ko)

Merci, je vais essayer de modéliser quelque chose.

Mais mes connaissances sont assez limitées en VBA

si besoin, reviens avec un bout de fichier

Voila le fichier, je regarde de mon côté pour essayer de faire quelque chose de correct

au final, j'ai besoin de vos lumières....

J'ai réussi à transformer le chrono en décompte de 15 secondes, mais je n'arrive pas à lui faire faire une boucle quand il arrive a 0 et je n'arrive pas non plus à l'intégrer dans mon codage, ça plante à chaque fois....

Le décompte s'affiche en J1

Je m'incline devant tant de génie !

Merci bcp

et clique sur le coeur si le coeur t'en dis !!

Rechercher des sujets similaires à "afficher compte rebours macro"