Interactive search bar

esben

New Member
Joined
Feb 15, 2018
Messages
8
Hi guys.

I have a large datasheet in which i have tabel 1. This tabel contains 5 coloums and 200 rows. I Would like to insert/create a search bar in which i Can type words and then the search bar should ‘hide’ Rows that does not have any of the five coloum resultat in common with the searched word.
It is sort of like the ‘filter’ option but based on All coloums directly. It Would be Nice if it changed everytime a letter Was put in

Hope the question is understadeble and that someone Can quide me in the right direction.

Best regards,

Esben
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Form have a Textbox1 to search word, a Commandbutton Unhidden, a Commandbutton Exit form.
Code:
Private Sub CommandButton1_Click()  'Exit
Unload Me
End Sub


Private Sub CommandButton2_Click()  'Unhidden
Range("A1:E200").EntireRow.Hidden = False
End Sub


Private Sub TextBox1_Change()
Application.ScreenUpdating = False
Dim cel As Range, rngV As Range


If TextBox1 <> "" Then
Set rngV = Range("A1:E200")
Rows("1:200").EntireRow.Hidden = False


For Each cel In rngV
    If cel.Column = rngV.Column Then t = 0
    If InStr(1, cel, TextBox1) > 0 Then
        t = t + 1
    End If
    Rows(cel.Row).EntireRow.Hidden = (t = 0)
Next


End If


Application.ScreenUpdating = True
End Sub
 
Last edited:
Upvote 0
Sadboy309 i just found out that when You search it differentiate between caps and Non-caps letters. Is this possible to get around from?
 
Upvote 0
Where I find keyword I used this code:

Code:
[COLOR=#333333]If InStr(1, cel, TextBox1) > 0 Then[/COLOR]

If you don't want differentiate between caps and Non-caps, So you will need change those line this code, As:

Code:
[/COLOR][COLOR=#333333]If InStr(1, UCase(cel), UCase(TextBox1)) > 0 Then[/COLOR][COLOR=#333333]

Dear.
 
Upvote 0
Simply change this line
Code:
If InStr(1, cel, TextBox1) > 0 Then
to
Code:
If InStr(1, Cel, TextBox1, vbTextCompare) > 0 Then
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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