Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default filter multiple columns for one value

I am trying to use excel to run a database(cos i really dont like office) but
i am relatively new to coding.

At the moment I am running a search by filtering the colums to match user
inputted data, I have come accross a problem as I need to search for one
value that can occur in up to 19 columns, but i have to keep every row of
data that it appears in just once.

Any help would be grreatly appreciated
Thank you
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default filter multiple columns for one value

In this example, the data is in cols B thru T and in rows 2 thru 100. Put
the match value in A1 and run:

Sub OnlyOneTime()
v = Range("A1").Value
For i = 2 To 100
Set r = Range("B" & i & ":T" & i)
If Application.WorksheetFunction.CountIf(r, v) 0 Then
Rows(i).Hidden = False
Else
Rows(i).Hidden = True
End If
Next
End Sub
--
Gary''s Student - gsnu200825


"Miree" wrote:

I am trying to use excel to run a database(cos i really dont like office) but
i am relatively new to coding.

At the moment I am running a search by filtering the colums to match user
inputted data, I have come accross a problem as I need to search for one
value that can occur in up to 19 columns, but i have to keep every row of
data that it appears in just once.

Any help would be grreatly appreciated
Thank you

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
Filter Multiple Columns on Multiple Criteria and count the last co LBitler Excel Worksheet Functions 2 February 12th 09 08:36 PM
Filter on multiple columns tommcbrny Excel Discussion (Misc queries) 1 May 12th 08 05:13 PM
How do I filter multiple columns at once? Aaron Excel Discussion (Misc queries) 5 July 6th 07 12:28 PM
how do i filter multiple columns Teric506 Excel Worksheet Functions 1 September 20th 05 08:59 PM
how do I filter for 1 variable in multiple columns California Excel Worksheet Functions 1 March 18th 05 10:36 PM


All times are GMT +1. The time now is 11:49 PM.

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

About Us

"It's about Microsoft Excel"