Hiding Rows Based on Matching Value in Specific Cells

cheesiepoof05

Board Regular
Joined
Dec 30, 2010
Messages
82
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
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
If you format a date as short date what do you get?
 
Upvote 0
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.
 
Upvote 0
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"))
 
Upvote 0
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.
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,822
Messages
6,121,770
Members
449,049
Latest member
greyangel23

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