• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 186
  • Last Modified:

How do I find the end of excel range and then filter that range

Hello Exports,

I have a range that goes from column A to column M, but the number of rows can vary.  I would like to use VBA to find the end of the range and then filter that range to show all values in column M that are less than 7.25

Any suggestions on how I could do this?

Thanks in advance.
JJ
0
JJINFM
Asked:
JJINFM
1 Solution
 
McOzCommented:
Use some code like this:
Sub filterRange()
    Cells(1, 1).End(xlToRight).End(xlDown).AutoFilter Field:=13, Criteria1:="<7.25"
End Sub

Open in new window


It finds the end of the data both in columns and rows (starting in A1), and filters it all by column M (13) where value is less than 7.25

Good luck!
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now