Saberexcel - site das macros
macros do aplicativo microsoft excel vba que chamam barras de menu desejadas
Macro - Barra Progressão
Congela controles_II
Minha Barra de Progressao
Cria uma barra de progressão colorida na planilha
VBA Excel
‘Esta macro chama as barras menu desejadasSub Congela_Controles() Application.OnDoubleClick = "chama_macro"CommandBars("worksheet Menu Bar").Controls("Extras"). _ Controls("controle…”").Enabled = False CommandBars("Chart Menu Bar").Controls("Extras"). _ Controls("controle…").Enabled = False CommandBars("Toolbar List").Enabled = FalseEnd Sub‘—‘‘Macro para chamadaSub chama_macro()‘Insira o códigoEnd Sub‘—‘
‘Esta macro descongela os controles desejadosSub Congela_Controles_II() Application.OnDoubleClick = "chama_macro" CommandBars(”Worksheet Menu Bar”).Controls("Extras"). _ Controls("controle…").Enabled = True CommandBars("Chart Menu Bar").Controls("Extras"). _ Controls("controle…").Enabled = True CommandBars("Toolbar List").Enabled = True RestoreDoubleKlickEnd Sub‘—‘‘Restaura o Duplo ClicSub RestoreDuploClick() Application.OnDoubleClick = “”End Sub
Site das macros Excel VBA
( 15.000 Macros, Funções, Fórmulas, Blog, Apostilas, Dicas, Boletins, 14.000 Planilhas Modelos
http://www.saberexcel.com/comprar.htm
Insere uma barra de progressao
‘Esta macro insere uma barra de progressão com o percentual na Statusbar
Sub Minha_Barra_Progressao()
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 120#, 102#, 300, 10).Select Selection.Name = “fond” With Selection.ShapeRange.Fill .ForeColor.SchemeColor = 10 .Visible = msoTrue .Solid End WithActiveSheet.Shapes.AddShape(msoShapeRectangle, 120, 102#, 6#, 10#).SelectSelection.Name = “prog” With Selection.ShapeRange.Fill .ForeColor.SchemeColor = 11 .Visible = msoTrue .Solid End With Tot = 100 For i = 1 To Tot For ii = 1 To 100 Range(”A1″).Select Next ii ActiveCell = i Application.StatusBar = “Trabalho em progressão! : ” & i / Tot & “/1 Efetuados” ActiveSheet.Shapes(”prog”).Select Selection.ShapeRange.IncrementLeft 300 / Tot DoEvents Next i MsgBox “Terminou !”, 64, ” © Saberexcel.com” Application.StatusBar = “” Selection.Delete Range(”A1″).Clear ActiveSheet.Shapes(”fond”).Selectn style="font-size: 11pt; font-family: Arial; mso-ansi-language: EN-US;" lang="EN-US"> Selection.DeleteEnd Sub
Insere uma barra de progressão
‘Esta macro insere uma barra de progressão
Option Explicit
Sub BarraDeProgreso()
Dim R As IntegerDim MT As DoubleFor R = 1 To 180 MT = Timer Do Loop While Timer - MT < 0.05 Application.StatusBar = “Progress: ” & R & ” de 180: ” & _ Format(R / 180, “Percent”) & ” — ” & “realizados” DoEventsNext RApplication.StatusBar = FalseEnd Sub
‘———————————-’
E. Marcondes
Cria uma barra de progressão colorida na planilha
Esta macro cria uma barra de progressão colorida na planilha
Sub CreateBars()
Dim sh As Shape Dim cell As Range Dim count As Long For count = 1 To 10 Set cell = Range(”A1″).Offset(count, 1) With ActiveSheet.Shapes Set sh = .AddShape(msoShapeRectangle, cell.Left, cell.Top, 0, cell.Height) With sh.Fill .ForeColor.SchemeColor = count + 2 .Visible = msoTrue .Solid End With sh.Name = “PB” & count End With NextEnd Sub ’————’Sub DemoProgressBars() CreateBars Dim sh As Shape Dim cell As Range Dim count As Long Dim pc As Long Dim ar(1 To 10) As Long Dim done As Boolean Dim timernow As Double ‘ reset bars to zero width For count = 1 To 10 ActiveSheet.Shapes(”PB” & count).Width = 0 Next Do done =True For count = 1 To 10 pc = ar(count) + Int(Rnd() * 10) If pc > 100 Then pc = 100 ar(count) = pc If pc < 100 Then done = False Set sh = ActiveSheet.Shapes(”PB” & count) sh.Width = Cells(count + 1, “B”).Width * pc / 100 Next DoEvents timernow = Timer Do: Loop Until Timer - timernow > 0.25 Loop Until done
End Sub
( 15.000 macros, funções, fórmulas, Blog, Apostilas, Dicas, Boletins, 14.000 planilhas modelos)
http://www.saberexcel.com/comprar.html
Escrito por...: E. Marcondes
Barra de progressão com o percentual na Statusbar
Esta macro insere uma barra de progressão com o percentual na Statusbar
Sub Minha_Barra_Progressao()
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 120#, 102#, 300, 10).Select Selection.Name = “fond” With Selection.ShapeRange.Fill .ForeColor.SchemeColor = 10 .Visible = msoTrue .Solid End WithActiveSheet.Shapes.AddShape(msoShapeRectangle, 120, 102#, 6#, 10#).SelectSelection.Name = “prog” With Selection.ShapeRange.Fill .ForeColor.SchemeColor = 11 .Visible = msoTrue .Solid End With Tot = 100 For i = 1 To Tot For ii = 1 To 100 Range(”A1″).Select Next ii ActiveCell = i Application.StatusBar = “Trabalho em progressão! : ” & i / Tot & “/1 Efetuados” ActiveSheet.Shapes(”prog”).Select Selection.ShapeRange.IncrementLeft 300 / Tot DoEvents Next i MsgBox “Terminou !”, 64, ” © Saberexcel.com” Application.StatusBar = “” Selection.Delete Range(”A1″).Clear ActiveSheet.Shapes(”fond”).Select Selection.DeleteEnd Sub
postado por E. Marcondes
Barra de Progressão na statusbar
BARRA DE PROGRESSÃO
'Esta macro mostra um status da statusbar processando progresso barra de com caracteres na barra de status indicando o progresso da ação.
Sub StatusBar_Progresso()
Application.ScreenUpdating = False
SBText = "Processando….."
Aprenda tudo sobre planilhas do Aplicativo Microsoft Excel VBA(Visual Basic Application), sozinho, com baixo custo, praticando com os produtos didáticos Saberexcel