Find Values from Sheet2 on Sheet 1 and Hide Those Rows

silverbluemoon

New Member
Joined
May 19, 2010
Messages
25
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
So I admit, this is probably way easier than I've made it out to be, but considering I've spent most of two days trying to figure this out and have yet to do so, I have arrived here, desperately hoping someone here will take pity on me and help me out.

  • I have two sheets in a file called MyFile.
  • Sheet1 has a full table of data in named range "myNamedRange" - an array that spans Sheet 1 from A2:K322.
  • Sheet2 has a list of data in Column A (Range A2:A85) that I need to find in Sheet1 - either directly by the column the data is most likely to be found in [in this case, Column C ( specifically Range C2:C22)] -OR- via the named range array.

GOAL: Use the list of values in Sheet2 to hide all rows on Sheet1 that match.

Is there any way to do this? VBA is acceptable. Filters are acceptable. I just apparently don't know how to make either do what I need. I apologize in advance for the newbie question.

Please let me know if you need more information.

Thanks for helping!
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Hi silverbluemoon,

A relatively easy formula-based approach would be to add a helper column to Sheet1 that indentifies the matches, then use AutoFilters to hide those rows.

For example, place in K2, then copy down...
=MATCH(C2,Sheet2!A$2:A$85,0)
then filter to show only #N/A

Or for a nicer display, place in K2, then copy down...
=IF(ISNUMBER(MATCH(C2,Sheet2!A$2:A$85,0)),"Hide","Show")
then filter to show only "Show"

For a VBA approach, there are some examples in this thread that could be adapted...
http://www.mrexcel.com/forum/excel-questions/697963-excluding-items-out-filter-macro.html
 
Upvote 0
[SOLVED] Re: Find Values from Sheet2 on Sheet 1 and Hide Those Rows

Hi silverbluemoon,

A relatively easy formula-based approach would be to add a helper column to Sheet1 that indentifies the matches, then use AutoFilters to hide those rows.

For example, place in K2, then copy down...
=MATCH(C2,Sheet2!A$2:A$85,0)
then filter to show only #N/A

Or for a nicer display, place in K2, then copy down...
=IF(ISNUMBER(MATCH(C2,Sheet2!A$2:A$85,0)),"Hide","Show")
then filter to show only "Show"

For a VBA approach, there are some examples in this thread that could be adapted...
http://www.mrexcel.com/forum/excel-questions/697963-excluding-items-out-filter-macro.html

Jerry, you're a lifesaver! This worked perfectly. Thank you!!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,461
Messages
6,124,953
Members
449,198
Latest member
MhammadishaqKhan

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