Question:
How to add a progress bar to an existing VBA macro (using Excel 2010)?
rick g
2013-05-25 13:32:59 UTC
I would like to add a progress bar to the following VBA code (within Excel 2010):

Sub addComments()
' first we'll clear existing comments
For Each cmnt In ActiveSheet.UsedRange.Cells
cmnt.ClearComments
Next
' add a comment to cells that have something in them
For Each cell In ActiveSheet.UsedRange.Cells
' add a comment with current cells
cell.AddComment cell.Text
Next

' now we will change the size of the font
For Each cmmnt In ActiveSheet.Comments
With cmmnt.Shape
.TextFrame.AutoSize = True
.AutoShapeType = msoShapeRectangle
With .TextFrame.Characters.Font
.Size = 11
End With
End With
Next cmmnt
End Sub
Three answers:
anonymous
2013-05-27 01:40:52 UTC
n the past, with VBA projects, I've used a label control with the background colored and adjust the size based on the progress. Some examples with similar approaches can be found in the following links:



http://oreilly.com/pub/h/2607

http://www.ehow.com/how_7764247_create-progress-bar-vba.html

http://spreadsheetpage.com/index.php/tip/displaying_a_progress_indicator/



Or try these tools. I'm not expert in this but these may help

http://www.make.my/78cjcwka9k9
?
2016-10-07 07:39:11 UTC
Vba Progress Bar
simmonsjr
2016-10-28 23:37:07 UTC
Sub newValue() ' the subsequent line capacity columns a million to one hundred would be graded For a = 2 To one 0 one 'nevertheless a one hundred loops for a one hundred rows ' the subsequent strains set the right columns to grade Set colB = Cells(a, 2) Set colC = Cells(a, 3) ' the subsequent strains supply 1pt for suitable solutions and 0pts for incorrect If CStr(colB) = "10" Then colB.value = a million Else colB.value = 0 If colC = "Nucleic Acid" Then colC.value = a million Else colC.value = 0 Cells(a, 4).value = colB.value + colC.value next end Sub


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...