Filtering based on formatting one of many Userform Checkbox options

RockandGrohl

Well-known Member
Joined
Aug 1, 2018
Messages
788
Office Version
  1. 2010
Platform
  1. Windows
I have a feeling this is more complicated than I initially envisioned.

Let's say I have a userform that has multiple checkboxes on them:

  • Apple
  • Banana
  • Orange
  • Pear
  • Grape
  • Watermelon

If the user selects one, three, six or any variation of these checkboxes, how do I pass that into a filter on a range?

Cheers!
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Please share with us the entire script your using for your filter.
And are the checkboxes on your UserForm Named "Apple" or is the the checkbox Caption "Apple"
And are you wanting the filter script activated when you click on the checkbox?
 
Upvote 0
Hi, thanks for answering.

The script will be something regular like

VBA Code:
Range("A2:W" & Lastrow).autofilter field:=2 Criteria1:=(Apple, Banana)

I haven't built anything yet as I'm not sure it's possible from my knowledge.

The checkboxes have their "name" and then their proper name which is actually something like "N_Checkbox" and "Y_Checkbox" etc

Cheers
 
Upvote 0
Hi, thanks for answering.

The script will be something regular like

VBA Code:
Range("A2:W" & Lastrow).autofilter field:=2 Criteria1:=(Apple, Banana)

I haven't built anything yet as I'm not sure it's possible from my knowledge.

The checkboxes have their "name" and then their proper name which is actually something like "N_Checkbox" and "Y_Checkbox" etc

Cheers
Sorry maybe someone else will be able to help you.
I do not know what a Checkbox Proper Name is

I understand Name and Caption. But not Proper name
 
Upvote 0
Yeah I meant the Caption. Caption is "UK" but name is "Y_Radio"

It shouldn't matter what the name is though, if you give me something generic I can modify for my needs :)
 
Upvote 0
I would think it would be something like this:
Range("A2:W" & Lastrow).autofilter field:=2 Criteria1:=(Checkbox1.Caption

So you would need the Textbox Name.
 
Upvote 0

Forum statistics

Threads
1,213,549
Messages
6,114,264
Members
448,558
Latest member
aivin

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