Display selected cell at bottom of screen

T

Tonso

How can I insure that at the end of a macro the last row of data in the worksheet is visible at or near the bottom of the screen? The number of rows in the worksheet varies. If, for instance, there are 150 rows in a particular report, the selcted cell will be A150, but the screen shows rows 1-41, soA150 is not in view. I would like for A150 to be visible at or near the bottom of the screen when the macro finishes.

Thanks!

Tonso
 
C

Claus Busch

Hi Thomas,

Am Wed, 22 Aug 2012 05:03:35 -0700 (PDT) schrieb Tonso:
How can I insure that at the end of a macro the last row of data in the worksheet is visible at or near the bottom of the screen? The number of rows in the worksheet varies. If, for instance, there are 150 rows in a particular report, the selcted cell will be A150, but the screen shows rows 1-41, so A150 is not in view. I would like for A150 to be visible at or near the bottom of the screen when the macro finishes.

for me, the selected cell will be shown in the middle of the screen.
If you want it at the bottom, try:

LRow = Cells(Rows.Count, 1).End(xlUp).Row
Cells(LRow, 1).Select
ActiveWindow.ScrollRow = LRow - 40


Regards
Claus Busch
 
T

Tonso

How can I insure that at the end of a macro the last row of data in the worksheet is visible at or near the bottom of the screen? The number of rowsin the worksheet varies. If, for instance, there are 150 rows in a particular report, the selcted cell will be A150, but the screen shows rows 1-41, so A150 is not in view. I would like for A150 to be visible at or near the bottom of the screen when the macro finishes. Thanks! Tonso

Claus,

Thank you so much! Works great!
Sincerely,

Tonso
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top