Hiding Rows Based on Matching Value in Specific Cells

cheesiepoof05

Board Regular
Joined
Dec 30, 2010
Messages
78
I'm trying to set up a landing page where data selections can be entered and then based on those selections it hides records on the data set tab so that only what was selected on the landing page is shown on the data set tab, unless the landing page cell is left blank, then that column wouldn't be limited. So the workbook would open to "landing page" tab, they would populate "Dog", "Red", and leave the number cell blank. When the process button is pushed, it hides all records on the "Data Set" tab where column A is not "Dog", column B is not "Red", and since Number was left blank in this scenario, it wouldn't use that as a factor this time. We're trying to make a "cleaner" option than the user going to the data tab and limiting each column themselves. Thank you for your help.

1605880345586.png
 

Some videos you may like

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,251
Office Version
  1. 365
Platform
  1. Windows
If you format a date as short date what do you get?
 

cheesiepoof05

Board Regular
Joined
Dec 30, 2010
Messages
78

ADVERTISEMENT

Also, if I do an equal statement between the cell being filtered and the cell I'm using to filter, it comes back as TRUE that they are equal.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,251
Office Version
  1. 365
Platform
  1. Windows
In that case I'm surprised your having problems.
Try one of these two options
VBA Code:
If Ws.Range("B2") <> "" Then .Range("A1").AutoFilter 1, CDate(Ws.Range("B2"))
or
If Ws.Range("B2") <> "" Then .Range("A1").AutoFilter 1, CLng(Ws.Range("B2"))
 

cheesiepoof05

Board Regular
Joined
Dec 30, 2010
Messages
78
In that case I'm surprised your having problems.
Try one of these two options
VBA Code:
If Ws.Range("B2") <> "" Then .Range("A1").AutoFilter 1, CDate(Ws.Range("B2"))
or
If Ws.Range("B2") <> "" Then .Range("A1").AutoFilter 1, CLng(Ws.Range("B2"))
Bingo, the first option worked. Thanks so much, I was stumped.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,251
Office Version
  1. 365
Platform
  1. Windows
Glad to help & thanks for the feedback.
 

Watch MrExcel Video

Forum statistics

Threads
1,126,983
Messages
5,621,966
Members
415,869
Latest member
LWSkinner

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
Top