View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Apply Auto Filter on One Column

Sub Macro2()
Dim rng As Range
Dim lastcell As Range
Dim ilastrow As Long

With ActiveSheet

Set lastcell = .Cells.Find("*")

ilastrow = .UsedRange.Cells(.UsedRange.Cells.Count).Row
Set rng = .Range("H2", "H" & ilastrow)
.Range("H1").Value = "Temp"
rng.Formula = "=COUNTIF(E2:G2,""N"")0"
Range("H1").Resize(ilastrow).AutoFilter

End With
End Sub


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Bill Foley" <pttincatitexasdotnet wrote in message
...
Hey Gang,

Excel 2003

Thanks to Max and Bob is the MISC group I was able to create a dummy
column and use it to filter three columns of data. What I am looking for
is a method to do this using VBA (since I'm lazy and want to assign a
macro to a button on a toolbar).

Basically what I need is VBA code to:

1. Turn on the AutoFilter (which I know how to do), and,
2. Apply a filter to Column "T" (actually T2:T1529), for every value that
is "True"

FYI - column "T" is looking for every record in columns "E, F, and G" that
is "N" (formula is: "=COUNTIF(E2:G2,"N")0"). Reason I mention this is I
wouldn't mind being able to get rid of Column "T" (dummy column) and have
code that turns on the AutoFilter and filters all records where columns
"E, F, OR G" have "N". Either option would be much appreciated.

TIA!

--
Bill