# Periodic Status Bar Updates Based On Calculation

#### NamssoB

##### Board Regular
I'm processing a worksheet with thousands of records, and I'd like to keep the user updated with the progress using the status bar. BUT - I don't want to show the current record number EVERY time it changes (assuming this is VERY I/O intensive). So I want to display an updated status at even 10% increments. How do I do this?

Here's what I tried, but it's not even close. In essence, I try to convert a ROUNDED number to a 2-digit string (10.45 = "10"), then I use RIGHT to check if there is a zero.

Code:
``````        RowCountStatus = Round((1 - (lastrow / OrginalRowCount)) * 100, 0)
If Right(Str(RowCountStatus), 1) = "0" Then
Application.StatusBar = RowCountStatus & "% complete..."
End If``````

Any ideas?

### Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

#### NamssoB

##### Board Regular
Got it. Clumsy, but it works. B90, etc are booleans. Without the booleans, it would just display every single number, every time. So I used the booleans to "turn off" any repeats.

Code:
``````        RowCountStatus = 1 - (lastrow / OriginalRowCount)
If RowCountStatus > 0.9 And Not b90 Then
Application.StatusBar = Format(RowCountStatus * 100, "##") & "% complete..."
b90 = True
Else
If RowCountStatus > 0.75 And Not b75 Then
Application.StatusBar = Format(RowCountStatus * 100, "##") & "% complete..."
b75 = True
Else
If RowCountStatus > 0.5 And Not b50 Then
Application.StatusBar = Format(RowCountStatus * 100, "##") & "% complete..."
b50 = True
Else
If RowCountStatus > 0.25 And Not b25 Then
Application.StatusBar = Format(RowCountStatus * 100, "##") & "% complete..."
b25 = True
End If
End If
End If
End If``````

#### AlphaFrog

##### MrExcel MVP
Maybe something like this...

Code:
``````        [color=green]'Initialize[/color]
Application.StatusBar = "0% complete..."
NextStatus = 0.25 [color=green]'%Increment[/color]

[color=green]'loop Records[/color]
[color=darkblue]If[/color] NextStatus <= OriginalRowCount / lastrow [color=darkblue]Then[/color]
Application.StatusBar = Format(NextStatus, "0%") & " complete..."
NextStatus = NextStatus + 0.25  [color=green]'%Increment[/color]
[color=darkblue]End[/color] [color=darkblue]If[/color]
[color=green]'Next[/color]``````

#### NamssoB

##### Board Regular
Maybe something like this...

Code:
``````        [color=green]'Initialize[/color]
Application.StatusBar = "0% complete..."
NextStatus = 0.25 [color=green]'%Increment[/color]

[color=green]'loop Records[/color]
[color=darkblue]If[/color] NextStatus <= OriginalRowCount / lastrow [color=darkblue]Then[/color]
Application.StatusBar = Format(NextStatus, "0%") & " complete..."
NextStatus = NextStatus + 0.25  [color=green]'%Increment[/color]
[color=darkblue]End[/color] [color=darkblue]If[/color]
[color=green]'Next[/color]``````

Wow! Great idea, much simpler than mine. And it works....thank you!

Replies
2
Views
2K
Replies
0
Views
576
Replies
3
Views
605
Replies
3
Views
786
Replies
6
Views
562

1,171,626
Messages
5,876,519
Members
433,198
Latest member
itachi123

### 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.

### Which adblocker are you using?

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

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