Solved

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

Posted on 2011-03-15
1
180 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
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

789 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