multiple search and search bar

poobs_away

New Member
Joined
Aug 1, 2011
Messages
12
This will be my second post here. Is there a way in VBA to make a filter function that has a keyword search bar attatched? If there is I imagine it would be something that types the word into the keyword being filtered as you type in the search bar and then runs the macro when you hit the "search" button.

If anyone has a code for this could you also put comments in it so that I can have a better understanding of what the code is doing, if that's not too much to ask. Thanks.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Also the search bar was just a thought. If anyone can think of another way to do this without the search bar, but still make it accessible to other people who will eventually be using the sheet this macro is on, please tell. I only say search bar because I know VBA can make buttons, so I'm hoping it can make this as well. My excel version is 2010, if you need that information.

I also forgot to explain that I need this to have the ability to choose which column you're searching in. For example, in the worksheet I'm working with, column A is a from column and column C is a to column. The filter would need to be able to find all the keywords in just column A or just column C. Thank you.
 
Upvote 0
I think that you are talking about a UserForm with a TextBox to Search For, a TextBox to enter the column to search and a Search button. Am I right?
 
Upvote 0
yeah that sound about right. Sorry, I'm fairly new to VBA so I don't really know what it can and can't do, and I haven't found a way by just googling it yet.
 
Upvote 0
This is about as clear as I can describe it but I may have missed some stages. Try like this

Open Your workbook


Press ALT + F11

Insert > UserForm

Click on the UserForm - You should see a dialog with various objects

Click on abl to insert a textbox

Draw out on the form

repeat to add a second textbox & draw out on the form

Click the Command Button icon (looks like a button)

Do not (at this stage) rename any of the objects that you have created.

Click on ListBox1 and set its ControlSource to A1:a10


Click on ListBox2 and set its ControlSource to "A,B" etc.

Clickon the command button, right click

''''''


and so on...
 
Upvote 0
Cool, I looked up userform and how to make one and it looks easy enough for me to do. I guess my problem was I wasn't using the right terminology. Thanks man!
 
Upvote 0

Forum statistics

Threads
1,224,517
Messages
6,179,242
Members
452,898
Latest member
Capolavoro009

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