Progress bar variable assigning

kelly mort

Well-known Member
Joined
Apr 10, 2017
Messages
1,879
Office Version
  1. 2016
Platform
  1. Windows
Code:
       Call IntProgressBar
        With Sheet2.Range("D7:D" & lr)
            Set rngFind = .Find(what:=mySearch, After:=Sheet2.Range("D" & lr), _
            LookIn:=xlValues, lookat:=xlWhole, searchdirection:=xlNext)
            If Not rngFind Is Nothing Then
                strFirstFind = rngFind.Address
                Do
                   ListBox1.lstView.AddItem Trim(rngFind.Offset(, -2).Text)
                        For i = 1 To 137
                            ListBox1.lstView.List(ListBox1.lstView.ListCount - 1, i) = _
                            Trim(rngFind.Offset(, i - 2).Text)
        
        ‘ This is where I placed the progress code before, and I ran for a long time
                        Next i
                    Set rngFind = .FindNext(rngFind)
                    
                    Dim currentProgress#, progressPercentage#, BarWidth&
    
                    currentProgress = i / 137
                    BarWidth = Progress.Border.Width * currentProgress
                    progressPercentage = Round(currentProgress * 100, 0)
        
                    Progress.Bar.Width = BarWidth
                    Progress.Text.Caption = progressPercentage & "% complete"
        
                    DoEvents
                Loop While Not rngFind Is Nothing And rngFind.Address <> strFirstFind
            End If
        End With
        Unload Progress

Hello,
I am here again – the challenge gets tougher and interesting. I am trying my skills on the progress bar and I got stacked with this one. I want to show the progress while each row of data is loaded or filtered. I don’t know what to write at where. Can someone pull me out?

Thanks in advance
 

kelly mort

Well-known Member
Joined
Apr 10, 2017
Messages
1,879
Office Version
  1. 2016
Platform
  1. Windows

Some videos you may like

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

GWteB

Well-known Member
Joined
Sep 10, 2010
Messages
1,295
Office Version
  1. 2013
Platform
  1. Windows
You're welcome. Thanks for letting me know.
 

Watch MrExcel Video

Forum statistics

Threads
1,126,939
Messages
5,621,723
Members
415,853
Latest member
Newlife72

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top