Reputation: 320
I have a VBA Application which loops through a range and does some changes. However, I don't care much about the running time but I want to show the User that changes were made in run time.
I was thinking about something like this.
Private Sub ProcessALBODY(ByRef Fullpath, ByRef MasterWB)
...
For Each Row In rng.rows
... 'Do Something
DoEvents
ActiveWindow.ScrollRow = 1 'for each row scrolldown and proceed to next row
Next
...
End Sub
Unfortunately my application freezes until it has finished..
Upvotes: 1
Views: 71
Reputation: 9917
What select or hide not work?
rng.EntireRow.Hidden = True
For Each row In rng.Rows
row.EntireRow.Hidden = False
'do something.
rng.EntireRow.Hidden = True
Next
rng.EntireRow.Hidden = False
or
For Each row In rng.Rows
row.Select
'do something.
Next
Upvotes: 0
Reputation: 66
You could use the status bar to show progress. Use Application.StatusBar =
and then follow it with your choice of string, integer, etc. If it is put inside the 'For' statement, it would update with each iteration.
Upvotes: 0