Filtering based on formatting one of many Userform Checkbox options

RockandGrohl

Well-known Member
Joined
Aug 1, 2018
Messages
594
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

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
17,570
Office Version
  1. 2013
Platform
  1. Windows
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?
 

RockandGrohl

Well-known Member
Joined
Aug 1, 2018
Messages
594
Office Version
  1. 2010
Platform
  1. Windows
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
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
17,570
Office Version
  1. 2013
Platform
  1. Windows
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
 

RockandGrohl

Well-known Member
Joined
Aug 1, 2018
Messages
594
Office Version
  1. 2010
Platform
  1. Windows
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 :)
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
17,570
Office Version
  1. 2013
Platform
  1. Windows
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,129,691
Messages
5,637,846
Members
416,986
Latest member
zmartee

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