Filtering Rows based on A Value Amongst Several Columns of Data

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,562
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
If I have a range of data, A13: R64, what is the best through VBA to filter only those rows that have a particular value in any of the cells of that range.

Basically, show only the rows which contain the value of A1 in any of the cells in the range.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
What do you want to do with the items not meeting your filter? Deletion? Autofilter?

I've used autofilter such as the following (loosely - you'd need to modify it for your use):
Range().Autofilter Field:= ______ Criteria1:= _____________

For criteria, it sounds like you have a specific cell in mind, so you could put that there - the rest I'm not as sure about for your example!
 
Upvote 0
Hi shal ...

Yeah, I figured my explanation may have been a bit vague.
The database 18 columns wide, by 64 rows starting at A13. So the range A13:R64. In those cells are several different people's names. What I need to do is isolate all the rows in which one select name occurs in any one (or more) of the 18 columns. Any rows not having that name anywhere within the 18 columns, will be simply hidden. So looks like an autofilter. Not certain whether an autofilter would work in this scenario.
 
Upvote 0
Ah, I misunderstood the purpose.. If you have 18 columns the value could potentially come up in, you could probably set up a SELECT query of some sort to query against the list and return the rows in which those values existed.
 
Upvote 0
Hi Andrew ... that is the route I went with!
Thank you all for your suggestions. I have added a bit more to my knowledge base.
 
Upvote 0

Forum statistics

Threads
1,214,375
Messages
6,119,168
Members
448,870
Latest member
max_pedreira

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top