Progress bar variable assigning

kelly mort

Well-known Member
Joined
Apr 10, 2017
Messages
2,169
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
 
Upvote 0

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,214,651
Messages
6,120,744
Members
448,989
Latest member
mariah3

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
Back
Top