Avatar of upobDaPlaya
upobDaPlaya
 asked on

Need to page down in a MS Excel VBA module once I get to approximately row 46

I have a VBA modules that loops that thru each row in an Excel 2007 spreadsheet.  I make the spreadsheet visible to the user as it loops thru each row.  My dilemma is that once it gets to row 46 approximately the module continues to loop as expected, but visually the focus remains on row 46 and the user can not see the updates as they occur beyond row 46.

What is the code required so that the focus is in synch with the loop.  Thus if the loop is on row 56 the user should be viewing row 56.
Microsoft ExcelVBA

Avatar of undefined
Last Comment
upobDaPlaya

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
[ fanpages ]

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
Michael Fowler

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Martin Liss

If fanpages' code doesn't do what you want then please attach your workbook or a facsimile.
[ fanpages ]

Alternatively, if you wish the worksheet to scroll every 46 rows processed...

Public Sub Q_28701027()

  Dim lngRow                                            As Long
  
  For lngRow = 1& To 1000&
  
      DoEvents
      
      If lngRow Mod 46& = 0 Then
         Application.Goto Reference:=Cells(lngRow, 1), Scroll:=True
      End If
      
      Cells(lngRow, 1) = lngRow * Rnd() <- Setting value of column [A] on each row for a demonstration
      
  Next lngRow
  
End Sub

Open in new window

upobDaPlaya

ASKER
Thx..Fanpage solution worked...Michael than you for the suggestion..
Your help has saved me hundreds of hours of internet surfing.
fblack61