Você está na página 1de 1

'início do código

abrirBarraProgresso ' barra de progresso


W = Range("A6").End(xlDown).Offset(0, 0).Row ' quantidade de itens na planilha
cont = 1 ' contador inicial

'continuar macro após cair SAP


If Range("I7").Value = "OK" Then
i = Range("I6").End(xlDown).Offset(1, 0).Row 'determinar a linha em que parou o SAP
cont = i - 6

'inicio looping

'INSERIR APÓS VALIDAÇÃO DO LOOPING


cont = cont + 1
progredirBarraProgresso (cont / w))
DoEvents

' termino do looping

'final do programa

fecharBarraProgresso

Function abrirBarraProgresso()

BarradeProgresso.BarraAndamento.Width = 0
BarradeProgresso.Show (vbModeless)

End Function

Function fecharBarraProgresso()

Unload BarradeProgresso

End Function

Function progredirBarraProgresso(andamento As Double)

widthTotal = 252
widthAtual = widthTotal * andamento

BarradeProgresso.BarraAndamento.Width = widthAtual
BarradeProgresso.TextoAndamento.Caption = Round(andamento * 100, 2) & "% Completo"

End Function

Você também pode gostar