Hi every one
I used following code to filter the data where cbopdt is a combo Box and Model is column heading. My problem is I can filter only exact matching value by this code but I want to show some likely matching data also so what should I do?
strSQL = "SELECT * FROM [sheet1$] WHERE "
If cbopdt.Text <> "" Then
strSQL = strSQL & " [Model]='" & cbopdt.Text & "'"
End If
If my data contains 1.Winner , Winner, winner in a model column then I want to show all these in my another sheet. In VB 6 I uses like
If cbopdt.text <> "" then
strSQL=strSQL & " model like '%" cbopdt.text & "%'"
End if
but that doesn't work in Excel VBA so please help me to solve my problem!
I used following code to filter the data where cbopdt is a combo Box and Model is column heading. My problem is I can filter only exact matching value by this code but I want to show some likely matching data also so what should I do?
strSQL = "SELECT * FROM [sheet1$] WHERE "
If cbopdt.Text <> "" Then
strSQL = strSQL & " [Model]='" & cbopdt.Text & "'"
End If
If my data contains 1.Winner , Winner, winner in a model column then I want to show all these in my another sheet. In VB 6 I uses like
If cbopdt.text <> "" then
strSQL=strSQL & " model like '%" cbopdt.text & "%'"
End if
but that doesn't work in Excel VBA so please help me to solve my problem!