Boa tarde!!
Se alterar para:
For i = 1 To 10
chegando aos 10% finaliza.
se alterar este:
For j = 1 To 6
para, por exemplo:
For j = 20 To 20
, avança muito mais rápido, mas mesmo assim não avança conforme a macro - verificando dados e copiando para a guia Registo de Ponto Diário.
A minha macro tem cerca de 14 rotinas. Assim, por exemplo quando chegasse às 7, a barra deveria estar nos 50%, e assim por diante...como neste exemplo que encontrei na net:
Option Explicit
'========================================================================
'Cover Macro to Test the Progress Bar
'========================================================================
Sub TestTheBar()
'Disable Screen Updating and Events
Application.EnableEvents = False
Application.ScreenUpdating = False
'Declaring Sub Level Variables
Dim lngCounter As Long
Dim lngNumberOfTasks As Long
'Initilaizing Variables
lngNumberOfTasks = 10000
'Calling the ShowProgress sub with ActionNumber = 0, to let the
'user know we are going to work on the 1st task. Also, set a
'title for the form
Call modProgress.ShowProgress(0, lngNumberOfTasks, _
"Excel is working on Task Number 1", False, _
"Progress Bar Test")
For lngCounter = 1 To lngNumberOfTasks
'The code for each task goes here
'
'Call the ShowProgress sub each time a task is finished to
'the user know that X out of Y tasks are over, and that
'the X+1'th task is in progress.
Call modProgress.ShowProgress(lngCounter, lngNumberOfTasks, _
"Excel is working on Task Number " & lngCounter + 1, False)
Next lngCounter
'Enable ScreenUpdating and Events
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
Mas não tenho conhecimentos suficientes para conseguir adaptar na minha macro.
Att.
Postado : 24/05/2016 10:36 am