PDA

View Full Version : Option Enabled Search



sam05hart
08-05-2018, 04:51 PM
Hello,

I am a very new and basic user of VBA so thank you ahead of time for your patience. I would like be able to use option boxes to dictate what will be searched and what will populate in my cover sheet. For example, if I have "Type" pressed and put "200" in the text box and hit search all of the results with type 200 will show up on the cover page. Right now I have the VBA code that pulls up the "Part Number" but that is not linked to the option buttons, those are just for show. As I am brand new to this forum please let me know if you will be needing additional information. Any and all information would be beneficial.

Please see the attachment for clarification.

Thanks,

p45cal
08-06-2018, 06:36 AM
In the attached, Coversheet cells I1 contain a number, being which option button is selected. It's the linked cell to your group of option buttons. This number is then used to decide which column to search.
You may also be interested in Coversheet (2) which uses a different approach. Fill in any number of green cells and click Search. Return all results by clearing the green cells (button provided) and clicking Search.

sam05hart
08-06-2018, 07:24 AM
Thank you. This has been extremely helpful. Just one question, it may be elementary, but how did you assign the values to the option buttons?

p45cal
08-06-2018, 08:49 AM
Thank you. This has been extremely helpful. Just one question, it may be elementary, but how did you assign the values to the option buttons?I didn't; that's how they come.

22676

22677

Select various option buttons to see which value each carries.
You only need to link one of the option buttons to a cell, all the other option buttons in the same group automatically also link to that cell.
If you want more than one group then you have to include those you want to group inside a Frame (oops, Group Box) (but you don't need that here).

sam05hart
08-06-2018, 09:00 AM
Ahh, I see. Thank you. You have been a huge help.