1

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

3
  • 1
    ActiveWindow.ScrollRow = Row.Row Commented May 29, 2019 at 0:36
  • @TimWilliams Saved my day sir, please write it as an answer! Commented May 29, 2019 at 0:47
  • Hey @V.Hunon what about mine?!? Aside from inducing seizures, it is awesome?!?! ☄😜 Commented May 29, 2019 at 15:50

3 Answers 3

2
ActiveWindow.ScrollRow = Row.Row

should do what you want

Sign up to request clarification or add additional context in comments.

1 Comment

Nice. Better than mine.
0

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.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.