Solved

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

Posted on 2011-03-15
1
182 Views
Last Modified: 2012-05-11
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
Comment
Question by:JJINFM
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 9

Accepted Solution

by:
McOz earned 500 total points
ID: 35140792
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question