Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Filtering Records Help Please

Hello,

Could someone please help me with the following:

In column A are a series of single digit numbers (0, 1, 2, 3, 4, 5, 6, 7
,8 ,9). There is one single digit per row and approximately 21,000 rows.
They are not in any particular order. The Header-row name located in
cell A1 is named: 141_Stat_Code.

I wish to filter column A to show only the single digit numbers: 0, 1,
2, 5, 7, 8.

The worksheet name is: Unacquitted_142s

I would like to run a macro to filter my desired records as detailed
above.

I am using Excel 2003.

If anyone could please help that would be greatly appreciated.

Thanks,

Chris.

Live Long and Prosper :)

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default Filtering Records Help Please

You can record a macro as you apply an advanced filter to the list.
There are instructions in Excel's Help, and he

http://www.contextures.com/xladvfilter01.html

Chris Hankin wrote:
Hello,

Could someone please help me with the following:

In column A are a series of single digit numbers (0, 1, 2, 3, 4, 5, 6, 7
,8 ,9). There is one single digit per row and approximately 21,000 rows.
They are not in any particular order. The Header-row name located in
cell A1 is named: 141_Stat_Code.

I wish to filter column A to show only the single digit numbers: 0, 1,
2, 5, 7, 8.

The worksheet name is: Unacquitted_142s

I would like to run a macro to filter my desired records as detailed
above.

I am using Excel 2003.

If anyone could please help that would be greatly appreciated.

Thanks,

Chris.

Live Long and Prosper :)

*** Sent via Developersdex http://www.developersdex.com ***



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Filtering Records Help Please

Another approach is to add a column to the right

in F2 for example
=if(or(A2<3,A2=5,A2=7,A2=8),"Show","No Show")
then drag fill it down the column.

Then apply an autofilter and filter on the column with the formula.

You can also do this with a macro (uses the next available column)

Sub ABCD()
Dim rng As Range, s As String
Dim rng1 As Range
Set rng1 = Cells(1, "IV").End(xlToLeft)(1, 2)
s = "=if(or(A2<3,A2=5,A2=7,A2=8),""Show"",""No Show"")"
Set rng = Range(Cells(2, 1), Cells(2, 1).End(xlDown))
rng.Offset(0, rng1.Column - 1).Formula = s
Cells(1, rng1.Column).Value = "Header6"
Range("A1").CurrentRegion.AutoFilter Field:=rng1.Column, _
Criteria1:="Show"

End Sub

--
Regards,
Tom Ogilvy

"Debra Dalgleish" wrote in message
...
You can record a macro as you apply an advanced filter to the list.
There are instructions in Excel's Help, and he

http://www.contextures.com/xladvfilter01.html

Chris Hankin wrote:
Hello,

Could someone please help me with the following:

In column A are a series of single digit numbers (0, 1, 2, 3, 4, 5, 6, 7
,8 ,9). There is one single digit per row and approximately 21,000 rows.
They are not in any particular order. The Header-row name located in
cell A1 is named: 141_Stat_Code.

I wish to filter column A to show only the single digit numbers: 0, 1,
2, 5, 7, 8.

The worksheet name is: Unacquitted_142s

I would like to run a macro to filter my desired records as detailed
above.

I am using Excel 2003.

If anyone could please help that would be greatly appreciated.

Thanks,

Chris.

Live Long and Prosper :)

*** Sent via Developersdex http://www.developersdex.com ***



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Filtering Records Help Please

Thanks Debra,

I'll check the web-link you sent,

Cheers,

Chris.

Live Long and Prosper :)

*** Sent via Developersdex http://www.developersdex.com ***
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Filtering Records Help Please

Thanks very much Tom,

Your VBA code worked very well - much appreciated.

Cheers,

Chris.

Live Long and Prosper :)

*** Sent via Developersdex http://www.developersdex.com ***
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filtering a list with 67,000 plus records Debra Excel Discussion (Misc queries) 3 February 23rd 09 11:23 PM
Filtering records dk New Users to Excel 10 January 1st 08 07:13 PM
Filtering out old records. david.palmer Excel Discussion (Misc queries) 1 March 24th 06 04:20 PM
Filtering Records GregOnline Excel Worksheet Functions 1 October 21st 05 05:17 AM
Filtering records Ryan RBG Excel Programming 3 July 23rd 04 09:01 AM


All times are GMT +1. The time now is 12:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"