How to have VBA scroll the worksheet so that last row of current selection is in view
Example: If I have range C6:F500 selected I'd want that last row 500 in view, another time it may be C6:F200, so I'd want that last row 200 in view
Scroll worksheet to see last row in selection
-
acat -
August 9, 2019 at 12:01 AM -
Thread is marked as Resolved.
-
-
-
-
Two things:
1. I need it to just scroll to last row in existing selection, not to make a different selection by selecting last cell, i.e. to keep existing selection which was also copied to clipboard before your proposed code
E.g.: if range C6:F300 is the current selection I only need the code to scroll down to make that last row 300 visible, not to make any new selections, but do keep original selection copied
2. Don't need it to scroll columns, only rows. Removing Selection.Columns.Count did not prevent scrolling of columns but prevented selecting cell in last row, instead selected cells seemingly at random mid current selection
Hope you can see what I mean -
-
Don't want it to select anything
Need it to leave current selected range as is
But only scroll to the last row of that already selected range
If it selects, then current selected range becomes deselected - I don't want that -
-
Quote
How to have VBA scroll the worksheet so that last row of current selection is in view
Scrolling implies moving!!
-
Your code is not scrolling however
Instead it makes a new selection
Need to scroll to put last row of existing selection into view -
-
first post:
How to have VBA scroll the worksheet so that last row of current selection is in viewGlad you have now got it - it works!
Thank you
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!