Filtering one column based on multiple arguements

I want to filter my spread sheet with a macro based on the information
in one column, the catch is that I'd like to hide anything that is one
of 5 different entries.  From my initial testing I concluded that Excel
might not support more than 2 arguements per column in a filter.  This
is a problem as I have thousands of entries with about 15 different
codes, but 5 of the codes are different ways of saying that something
didn't happen (each for a different reason which is important,
otherwise I could just use find/replace to code them all the same) I
want to view only the rows containing entries that did happen using a
filter, but the only way I have to do this is to write a macro that
checks each entry in the column to determine if it was one of these
codes and then hides them, stepping through a loop as it goes.

Here is what I've written for that piece:

Sub Operational()
Dim ColOTP As Integer
ColOTP = 7
For i = 2 To Worksheets("Data").UsedRange.Rows.Count
    With Worksheets("Data").Cells(i, ColOTP)
        If .Value = "Cancelled" Or _
            .Value = "Weather" Or _
            .Value = "Mechanical" Or _
            .Value = "None" Or _
            .Value = "Not Initialized" Then
                Worksheets("Data").Rows(i).EntireRow.Hidden = True
        End If
    End With
Next i
End Sub

While this is functional as itself, it is not functional if I apply
this and then try to filter based on a quality of something in a
different column, doing so unhides all the entries that were hidden via
the above macro that meet the quality of the filter.

0
mforner (1)
7/25/2006 9:59:45 PM
excel 39879 articles. 2 followers. Follow

1 Replies
301 Views

Similar Articles

[PageSpeed] 31

Matt wrote:
> I want to filter my spread sheet with a macro based on the information
> in one column, the catch is that I'd like to hide anything that is one
> of 5 different entries.  From my initial testing I concluded that
> Excel might not support more than 2 arguements per column in a
> filter.  This is a problem as I have thousands of entries with about
> 15 different codes, but 5 of the codes are different ways of saying
> that something didn't happen (each for a different reason which is
> important, otherwise I could just use find/replace to code them all
> the same) I want to view only the rows containing entries that did
> happen using a filter, but the only way I have to do this is to write
> a macro that checks each entry in the column to determine if it was
> one of these codes and then hides them, stepping through a loop as it
> goes.
>

Hi Matt,

I think you could try to use Advanced Filter instead of Automatic Filter. 
With Advanced Filter you can specify as many you want criteria to filter 
your table...


-- 
Hope I helped you.

Thanks in advance for your feedback.

Ciao

Franz Verga from Italy 


0
fra68ve (124)
7/26/2006 9:25:22 AM
Reply:

Similar Artilces:

need help replying to multiple email messages
I sell things on the internet, and when I receive say 5 emails for prospective buyers, I would like to be able to highlight all five of those and repsond to all of them at the same time instead of having to cut and paste five addresses individually. this has to be possible - anybody know how to do it? ...

Filters *SOS* Filters *SOS* Filters *SOS*
1) On formLoad, I need to show only those items which are unassigned. 2) I need for the end-under to select only the items they are assigned to. 3) I need an option to select "ALL" so I can view all items. Any insight offered would be appreciated!!! On Wed, 29 Aug 2007 16:24:01 -0700, valdaiway <valdaiway@discussions.microsoft.com> wrote: >1) On formLoad, I need to show only those items which are unassigned. Use a query to put a criterion on the field that defines the assigned status. I assume you know how that information is stored in your table; nobody here does, ...

Criteria for Advanced Filter HELP
I have what I think is a simple question that I need answered IMMEDIATELY. I have a spreadsheet with 20 fields and I want to filter it so it only shows records that have something in of any of 5 of those fields. So once filtered, I will not have any records that have all 5 of those fields blank. I know I have done this before but I'll be damned if I can remember or find out how. -- Thanks You all are teaching me so much don't cross-post -- answer supplied in misc NG "knowshowrosegrows" <knowshowrosegrows@discussions.microsoft.com> wrote in message news:ACBC0...

How do I plot multiple 3D surface charts
I have created a 3D image of a subsurface reservoir using the 3D surface chart. I would like to add additional images to the same chart, so that the chart will illustrate overlying subsurface reservoirs. I have attempted to do this using Chart - Add data but the resulting chart will display my original data ... the new data is displayed as a vertical wall. Is it possible to display more than one 3D surface image on a single chart in Excel. Thanks XL's 3D surface charts are pretty limited in what one can do with them. You may be able to create 2 separate charts and then mov...

How does one add field to Personal Address Book
I seem to be having a problem the address book. When you create a new message and press on the "To:" button to quickly add an address. a Window called "Select Names" pops up with a list of all contacts with varius columns namly "Name", "Display Name" and "Email Address". I can't seem to find anywhere I can customize this display of columns. I would not only like to add "Company" as a colum but would also like outlook to order it by Company as first option. anyone know where this can be done? I will really appreciate any input to...

Image in Knowledge base
Hi, Is it possible to add an image in an article of the knowledge base? Thanks for your help I don't think this is possible. But, it is pretty easy to drop in a hyperlink to a picture on another server, or a local file, etc. When you publish the article, the hyperlink becomes active and will open another window with the picture. Not that great, but it does work. Good luck! Steve C. "B. Guillout" wrote: > Hi, > Is it possible to add an image in an article of the knowledge base? > Thanks for your help ...

Employee Filters
Hello: On the employee filters in the HR Preferenes window, would this restrict seeing employee information in both Payroll and HR? Also, would it restrict reporting on certain employees in a division or department? Thanks! childofthe1980s Your message does not indicate which version of Great Plains you are using. Using 8.0 with SP3 applied, HR filters do apply to some of employee information outside of HR. The settings will filter selected forms, Smartlists and Lists items. The HR filter setting do not apply to reports outside of HR. The filtered forms are: Employee Maintenance,...

Hyperlink base: What does it do?
Excel 2007 I've been reading some posts on the hyperlink base feature, but I'm not sure what it's supposed to do. What I would THINK it should is that, when you press Ctrl-k in a cell, the Address would automatically appear as your base and the Current Folder would open to the base folder, so you could set you more- specific hyperlinked location from there. But that's not what happens. Does the hyperlink base have any practical value when creating hyperlinks using Ctrl-k? Thanks. ...

Filtering based on a filter
Hello, I have an Excel Worksheet with a Pivot Table at the top with a Filter and a data set returned from a DB2 database below it. I would like to filter the DB2 data set based on the Pivot Table filter that is enabled. Any ideas? Thanks! James, You can't filter two ranges on the same worksheet. You can, instead, drill-down on your pivot table, which will show all items that go into the value on a newly created separate sheet. The drawback to that is that you cna only drill down on one item at a time, and it is a separate sheet. HTH, Bernie MS Excel MVP "James" <an...

In Outlook 2003, how exactly does one go reset the view (outside of running a /cleanviews)?
Gurus, In Outlook 2003, how exactly does one go about resetting the view (outside of running /cleanviews)? -- Spin Select View > Arrange By > Current View > Define Views . Highlight one of the views and the select Reset button. Just so you know, the cleanviews switch deletes all custom views and resets the built-in ones back to their defaults. "Spin" <Spin@spin.com> wrote in message news:5njp48Fink5uU1@mid.individual.net... > Gurus, > > In Outlook 2003, how exactly does one go about resetting the view (outside > of running /cleanviews)? > &...

Combine columns of data into one
Hi, I want to combine columns of data into one, e.g. to combine column 1, 2 and 3 into column 4 column 1 column 2 column 3 column 4 1 a i 1 2 b ii a 3 c iii i 4 d iv 2 5 e v b 6 f vi ii 7 g vii 3 .... Thanks in advance. I should put the message under other catergory. Sorry about that. In your empyt co...

Filtering without Filter
I just don't get the following. Any ideas? "A" row I have two different values I use: "Contact" and "Not a contact". "B" row I have the person's name (employee). "C" row I have a quantity, just one number. Now what I need is to output quantities of how many Contacts Employee1 or Employee2 or Employee3 have. Also what I need is to get the number of contacts - which can be found on row "C". Should I use COUNT.IF ? Row A can have 2 or more different values so should there be somekind of conditional IF function included? T...

Question on the IMF filtering in exchange...
Hey I installed the IMF filter last night and it works great, with one exception. I set both thresholds to the same (5) and got almost all blocked emails into the archive that were junk...So that is good. However I had some users report that there was mail in their junk folder that should have been good Inbox mail. This I undersyand and can live with as folas-positives...the problem is, since both settings on the folter tab were set to 5, how does it know to send the mail to archive rather than Junk folder? Why wouldn't it just send them all to archive if both settings were at ...

Removing table column buttons?
Is there a way to remove the sort/filter buttons from specific columns in an Excel 2007 table? Our tables have certain columns that are very narrow and that we will never need to be sorted or filtered. Furthermore, the buttons cover-up the heading labels in those columns. Is there a way to manually disable the sort/filter feature for specific columns and remove the buttons? We also notice that converting a range to a table often changes the column size, especially of smaller columns. Is there a way to prevent this behavior? Thank you for any help with these items. a couple thing...

Filtering #11
Hi, can ayone tell me how I could do the following in excel 2007 or 2010: Horse Trainer Sam M Jones John M Jones Colin S Attwater Steve J Jackson Brian B Mathers James B Mathers Martin G Raggy Patrick S Thomson What I want to do is filter the dataset on 'Trainer' so that it only shows me the Trainers who feature once in the list. So if I was to do this properly it would only show S Attwater and G Raggy as the other trainers have more than one horse..... Hopefully someone can help because it is driving me crazy !! Thanks David Give this macro a try... Sub HideDuplicateTr...

Outlook freezes after sending one email after upgrading 4.0
We just upgraded from 3.0 to 4.0 this weekend. All client machines have had the desktop client upgraded and 2 have the same issue. One is XP with Outlook 2003 and the other is Vista with Outlook 2007. Open opens and the CRM addin initializes correctly. As soon as you compose and send an email, Outlook locks up and you have to kill the process in task manager to close Outlook. I've had the same problem and have tried all I can think of...how did you fix this issue? Thank you. "Sander" wrote: > We just upgraded from 3.0 to 4.0 this weekend. All client machines have...

Junk filter BEFORE other filters?
I am running Outlook 2003 and the Junk filter was working really well. Then I started making other filters...one of them looks for my domain name in the headers and if it's there it moves the email to a folder. Problem is, this filter seems to activate before the junk filter, so the junk sn't being filtered now! How can I set the junk filter to do it's job first and THEN to run my own rules? -- Bryan Anderson <www.anderson-it.com> I created this rule and set it as the first rule to run: Apply this rule after the message arrives with 'X-Spam-Level:******'or'...

Scrolling through several graphs on one chart?
Hi everyone, Suppose you have a 2D chart with multi-graphs inside; each represent different solution for example. Imagine, using VBA, you can create a Spin-button to scroll in-between those solutions on the chart one-by-one. For example, solution 1 on the chart will flash for 5 second, next solution 2 will flash and so on... On the other side, how can you select two or more solutions to flash at the same time; for the sake of comparison? Is this doable? Regards, Mike It doesn't use a spin button, but you might get some ideas from Jon Peltier's example on interactive charts:...

Going from one combo to another
I have a worksheet with some combo boxes. I want to hit the tab key and move from one combo to the next one. Is that possible? How is it done? -- bernardoafs ------------------------------------------------------------------------ bernardoafs's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=28993 View this thread: http://www.excelforum.com/showthread.php?threadid=489382 Hi, if you open goto your userform properties, there is an area called Tab Index. alter the numbers to your tab preference as they are automatically set by the point you added your combo b...

Macro to copy a VLOOKUP formula
Hello, I was wondering if somebody could help me with this macro… I have some data with a filter on, so that only the rows with blank cells are showing. I want to enter a VLOOKUP in the cell, and copy it down to all the blank cells. I tried just recording a macro, but when I run the macro it doesn’t work. Any ideas of how to do it? Example: 1) Before the filter: Colums A -B - C A x x - 1st Row A - 2nd Row A x x - 3rd Row A - 4th row A x x - 5th row 2) After the fil...

multiple (read-only) copies of one document?
we're on a small office network, with multiple people using publisher on their machines (some, winXP, some, win2000, ALL on publisher 2002) sometimes, two people need to access the same document at the same time. in word, or powerpoint, you can have a Read-Only copy of the same document open across a network. publisher doesnt seem to allow this. can anyone suggest a fix for this? After managing to set up OE-QuoteFix on his new PC, Ed reads a message from matt <matt@genevaglobal.com>... > sometimes, two people need to access the same document at > the same time. in word...

Pasting into a filtered list
Can anyone tell me if it is possible to paste a list of price updates into a filtered list. - I have filtered the list to show just the products whose prices need to be updated, when I try to paste the updated prices, into the list, the prices are not just pasted into the visible cells but the hidden cells between. Can I paste into the visible cells only or do I have to update each line manually. I am using Excel 2002 Any help would be much appreciated Can you sort the list to bring the products that need updating together in the list? If not, try something like this: Your list of product...

apply filter macro
I have a access db that works on win xp but does not work on win 2007 I have a combo box that triggers a apply filter macro using a query sort. no problem on win 2000 or win xp or win 2003 Help AlT ...

I need a formula to calculate the ratio of #'s in a row and column
Hello. I'm using Excel 2000 and need help finding a formula to calculate the ratio in columns and rows. For example: I'm using 1's and 0's ( 1 if the item is present and 0 if it is not present). So, I need a formula that will show 8/10 of the items were present. See my example below. Column C 1 0 1 0 1 =3 (sum) =3/5 (ratio) Thanks for your help!!!! Kelly =SUM(A1:A5)/COUNT(A1:A5) Format cell as a fraction Format>Cell>NumberTab>Fraction "KellyKulpa" wrote: > Hello. I'm using Excel 2000 and need help finding a formula to calculate the > r...

IP filtering based on corresponding MX records
Hello Dears, How can I implement the following? Used: Exchange 2003 SP2 in FE/BE configuration; FE is in perimeter zone (capable to “speak” with DNS, BE, DCs and retrieve info) So, somebody connects my FE to sent an e-mail to one of domain users. I need something like that: When connecting, see the “mail from: user@somedomain.xxx”; Verify if there is a record MX for the IP address from which the connection was established in DNS for the domain “somedomain.xxx” If not – drop connection (attention: MX record, not SPF) Is it possible with Exchange 2003 SP2 only? How? Thank you, Alex I be...