We need to write VB code to filter our table (states), whenever user types something in to the text box. For example, textbox1_change event runs whenever you change the textbox value (ie type something in to it, edit it or delete its contents). This will take you to Visual Basic Editor (VBE) and creates an emtpy textbox1_change() event.Īnswer: An Event is a macro (VBA code) that runs when a certain condition is satisfied. Right click on the text box and choose “view code”. Insert this control on your spreadsheet, preferably above the states table.Ĭlick on properties button in developer tab and set linked cell property of text box to an empty cell in your worksheet. Go to developer tab and click on insert > text box (active-x) control. Step 2: Insert a text box active-x control To keep it simple, let’s assume your values are in an Excel table named States. Step 1: Set up a list with values you want to filter. Let’s figure out how to do this using some really simple VBA code. Wouldn’t it be cool if Excel can filter as you type, something like this: But filtering requires a lot of clicks & typing. Filtering a list is a powerful & easy way to analyze data.
0 Comments
Leave a Reply. |