?
Solved

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

Posted on 2011-03-15
1
Medium Priority
?
184 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 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

762 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