Hi All,
I am trying to find the keywords into one sheet to another using userform Listbox & Textbox.
Textbox - will contain the data
ListBox - contain the Keywords
I need to display the clicked word in msgbox
speed response expected
Code is as follows :
*****************************************************************************************************
Option Compare Text
Private Sub CommandButton1_Click()
Dim counttxt As String
Dim mytxt As String
Dim dollarcount As Long
dollarcount = 0
ListBox1.Clear
If TextBox1.Text = "" Then
MsgBox "please input the raw data"
Else
ListBox1.Visible = True
lastrow = Sheets("Input").Cells(Rows.Count, "A").End(xlUp).Row
For i = 0 To lastrow - 2
counttxt = Sheets("Input").Cells(i + 2, 1).value
mytxt = TextBox1.Text
dollarcount = (Len(mytxt) - Len(Replace(mytxt, counttxt, ""))) / Len(mytxt)
counttxt = counttxt & dollarcount
If dollarcount > 0 Then
ListBox1.AddItem counttxt
End If
Next
End If
End Sub
*********************************************************************************
Regards,
Gokul S
Please supply your workbook and data so we can see what you are working with. Otherwise we have to recreate everything from scratch and this probably won't match your environment.
Regards
Phil