Goto First Row of Advanced Filtered Data..

omairhe

Well-known Member
Joined
Mar 26, 2009
Messages
2,040
Office Version
  1. 2019
Platform
  1. Windows
Hello Gurus,

How do I select and scroll to the first visible row of my active column after applying advanced filter to the data? The data always begin from row 5 and downwards with row 4 being the header.

Will appreciate a lot.
Anyone?
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
I'm not sure what you mean by "active column", but the following line of code will scroll to the first visible row. Note that it assumes that the sheet containing the filtered data is the active worksheet.

VBA Code:
ActiveWindow.ScrollRow = Range("A5", Cells(Rows.Count, "A").End(xlUp)).SpecialCells(xlCellTypeVisible).Cells(1).Row

Hope this helps!
 
Upvote 0
I'm not sure what you mean by "active column", but the following line of code will scroll to the first visible row. Note that it assumes that the sheet containing the filtered data is the active worksheet.

VBA Code:
ActiveWindow.ScrollRow = Range("A5", Cells(Rows.Count, "A").End(xlUp)).SpecialCells(xlCellTypeVisible).Cells(1).Row

Hope this helps!
I tested your code and it will work for scrolling to the first row, however, the cell automatically needs to be selected also , example, to select the first visible row's cell and not only scrolling to it.
What might change in your script to achieve this please?
 
Upvote 0
The following script will select the first Visible row starting from where the data begins in row 5 and downwards. Good but when it comes to the column, I do not want it to take me to column A. Instead I would like it to stay on the same active column after the code is executed. So in other words the column is dynamic to active column.

VBA Code:
Range("A5:A" & Rows.Count).SpecialCells(xlVisible)(1).Select
 
Upvote 0
What about

VBA Code:
Application.Goto Reference:=Range(Cells(5, ActiveCell.Column), Cells(Rows.Count, ActiveCell.Column)).SpecialCells(xlVisible).Cells(1)
ActiveWindow.ScrollRow = ActiveCell.Row
 
Upvote 0
Solution
What about

VBA Code:
Application.Goto Reference:=Range(Cells(5, ActiveCell.Column), Cells(Rows.Count, ActiveCell.Column)).SpecialCells(xlVisible).Cells(1)
ActiveWindow.ScrollRow = ActiveCell.Row

Thanks Peter.
 
Upvote 0

Forum statistics

Threads
1,213,562
Messages
6,114,326
Members
448,564
Latest member
ED38

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top