ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Scroll filtered sheet to top (https://www.excelbanter.com/excel-programming/353207-scroll-filtered-sheet-top.html)

XP

Scroll filtered sheet to top
 
I am using Office 2003 on Windows XP.

I have a program that moves a user from one sheet to another, then filters
the destination sheet based on what the user clicked on the first sheet. The
destination sheet must have a frozen split screen turned on.

Depending upon where the cell pointer is, sometimes the visible rows are
scrolled out of view. I need a code string that will cause the view to scroll
all the way to the top so that all unfiltered rows are visible to the user.

Could someone please post example code to do this?

Thanks much in advance.

sebastienm

Scroll filtered sheet to top
 
Hi,
Have you tried the Application.Goto method? It takes care of activating the
destination sheet and can scroll to the destination range.
'-------------------------------------
Sub test()
Dim rg As Range
Set rg = ActiveWorkbook.Worksheets("Sheet2").Range("AZ100")

Application.Goto reference:=rg, scroll:=True
End Sub
'--------------------------------------
--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"XP" wrote:

I am using Office 2003 on Windows XP.

I have a program that moves a user from one sheet to another, then filters
the destination sheet based on what the user clicked on the first sheet. The
destination sheet must have a frozen split screen turned on.

Depending upon where the cell pointer is, sometimes the visible rows are
scrolled out of view. I need a code string that will cause the view to scroll
all the way to the top so that all unfiltered rows are visible to the user.

Could someone please post example code to do this?

Thanks much in advance.



All times are GMT +1. The time now is 04:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com