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..
ActiveWindow.ScrollRow = Row.Row
should do what you want
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.
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
For Each row In rng.Rows row.Select 'do something. Next