selecting top left cel in a filtered list after scrolling down

littlepete

Well-known Member
Joined
Mar 26, 2015
Messages
503
Office Version
  1. 365
Platform
  1. Windows
hello all :)

this is NOT the question:
how do I select the first visible cell in a filtered list ? that I do know.

but:
how do I select that first visible cell on screen after scrolling down in a filtered list?
which vba line can fix that ?

thank you :) !!!
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
You can get the address of that cell with
VBA Code:
Debug.Print ActiveWindow.VisibleRange.Cells(1, 1).Address
although vba does not detect scrolling so there would be no way of automating the selection.
 
Upvote 0
You can get the address of that cell with
VBA Code:
Debug.Print ActiveWindow.VisibleRange.Cells(1, 1).Address
although vba does not detect scrolling so there would be no way of automating the selection.
ohhhh !!!

and hello ;)

I didnt know that ... but: it's my vba that chronologically puts the first item after or on today at the top...
that works well... so could there be a way to select the cell in column A of that first row after this:

VBA Code:
Sub scrolltoday()
    Dim Rng As Range
    Dim c As Range
    Dim firstrow As Long
    Dim lastrow As Long
    Dim foundrow As Long
    Dim searchdate As String
    firstrow = 5 'startrow for search - first cell under title
    searchdate = Format(Date, "mmdd") & "0"
    lastrow = Range("cd" & Rows.Count).End(xlUp).Row
    Set Rng = Range("cd" & firstrow & ":cd" & lastrow)
    foundrow = 0
    For Each c In Rng
        If c.Value > searchdate And foundrow = 0 Then foundrow = c.Row
    Next
    If foundrow > 0 Then ActiveWindow.ScrollRow = Rng(foundrow + 1 - firstrow).Row
    tooneersterij
End Sub

and, the "showfirstrow" macro (tooneersterij) is this:

Code:
Sub tooneersterij()
    If ActiveSheet.FilterMode = True Then
        ActiveSheet.AutoFilter.Range.Offset(1).SpecialCells(xlCellTypeVisible).Cells(1, 1).Select
    Else
        Range("a5").Select
    End If
Calculate
End Sub

so, is there a way ? ..
hoping !
 
Upvote 0
As you're using vba to scroll it should be simple, although I don't have a suitable workbook to hand to test the theory so it may involve a bit of trial and error.
Try changing the selection line in tooneersterij to
Excel Formula:
ActiveWindow.VisibleRange.Cells(1, 1).Select
and see what happens.
 
Upvote 0
Solution
ActiveWindow.VisibleRange.Cells(1, 1).Select

wowww !!! that works, and it's really not that difficult !!! but i never tried visiblerange...

so, thank you for the help :) !!!
and always welcome to try to "fix" the other questions :) !!! thank you !!!
 
Upvote 0

Forum statistics

Threads
1,214,376
Messages
6,119,175
Members
448,870
Latest member
max_pedreira

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