PDA

View Full Version : Autofilter On One Column?



mbake16
09-22-2009, 06:08 AM
Is there a way to apply an autofilter to just one column in a spreadsheet?

I've never known a way to do this and get around it by applying the autofilter to two columns and hiding the one I don't need. Just wondering if there is a better way?

mdmackillop
09-22-2009, 06:17 AM
Select the entire column first, then Data/Filter/Autofilter

Bob Phillips
09-22-2009, 06:17 AM
What is the problem? I can apply a single column autofilter within any difficulty.

mbake16
09-22-2009, 07:10 AM
Thanks for your response. I've attached an example of what I'm trying to do. On the attached spreadsheet I've created a macro that will add an autofilter to range("d5"). When I run the macro, the filters are applied to columns("D:I") in row 3. If I apply this macro to two cells, it works fine but with only one I cannot get it to work correctly. Any insight would be great!

mdmackillop
09-22-2009, 07:22 AM
Option Explicit
Sub AutoFilterOneCell()
Dim rng As Range
Set rng = Range(Cells(5, 4), Cells(Rows.Count, 4).End(xlUp))
rng.AutoFilter

End Sub

p45cal
09-22-2009, 07:23 AM
Range("D5:D19").AutoFilter

mbake16
09-22-2009, 08:30 AM
Awesome!! Thank you both for your help on this.