Goto last filtered row

Av8tordude

Well-known Member
Joined
Oct 13, 2007
Messages
1,074
Office Version
  1. 2019
Platform
  1. Windows
After auto-filtering my data, I would like to select (goto) the last filtered row. how can I do this in VBA
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
How about
VBA Code:
   Application.Goto Range("A" & Rows.Count).End(xlUp)
 
Upvote 0
Solution
Thank you Fluff. As always, you and others are greatly appreciated.
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0
In case ...
  • there is other data below the AutoFilter range or
  • columns are inserted so that column A is no longer part of the AutoFilter range or
  • the bottom visible cell(s) in column A of the AutoFilter range is/are blank
.. then this might be more robust.

VBA Code:
Sub LastFltrRow()
  With ActiveSheet.AutoFilter.Range.SpecialCells(xlVisible)
    With .Areas(.Areas.Count)
      .Rows(.Rows.Count).Select
    End With
  End With
End Sub
 
Upvote 0
In conjunction to going to the last row, how can I put a line under the selected row. I tried this, but it places a line under every row. I just want a line under the last filtered row.

VBA Code:
Range("A7:S" & lRow).LineStyle = xlContinuous
 
Upvote 0
With Peter's code just replace Select with
VBA Code:
Borders(xlBottom).LineStyle = xlContinuous
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,693
Members
448,979
Latest member
DET4492

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