Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to filter data in an Excel sheet?

Status
Not open for further replies.

arbo80

Programmer
Jan 5, 2006
53
US
Hi,
I have an excel sheet that looks like this:
Number Trn Status Trn Family TRN_DATE
25913 DEAD IRD 2/4/1999
25914 DEAD IRD 2/4/1999
25915 FIN CURR 2/4/2006
25916 DEAD CURR 2/4/1999
25917 FIN CURR 2/4/2006
25918 DEAD CURR 2/4/1999
25922 DEAD IRD 4/5/1999
25923 DEAD IRD 4/5/1999

I need a VBA code to ONLY select the numbers where the Status IS NOT "DEAD" and the Date is greater or equal to 2006. The resulting excel sheet should look like this:

Number Trn Status Trn Family TRN_DATE
25915 FIN CURR 2/4/2006
25917 FIN CURR 2/4/2006

Thanks,

AB

 
Turn on your macro recorder (Tools > Macro > Record New Macro) and use AutoFilter to get the sheet to look like you want.

TIP: If you want to end up with only the filtered data without still having the AutoFilter engaged, then filter out everything ELSE and delete it, then turn off AutoFilter.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
Thanks!! I can't believe that it was that simple.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top