tony.reynolds
Board Regular
- Joined
- Jul 8, 2010
- Messages
- 97
I'm wanting to search two columns for the string in TextBoxSearchItemList.text. then put these values into another list position.
as you can see here ive made a raw idea of what im trying to do but i think im trying the wrong method.
any help would be appreciated.
Ive tried to search for the TextBoxSearchItemList.text anywhere in the string using * each end but i dont know how to use it to well.
as you can see here ive made a raw idea of what im trying to do but i think im trying the wrong method.
any help would be appreciated.
Ive tried to search for the TextBoxSearchItemList.text anywhere in the string using * each end but i dont know how to use it to well.
Code:
Private Sub TextBoxSearchItemList_Change()
Dim CurrentSearchCell As Range
Dim CurrentFilteredListCell As Range
Dim Check1 As Boolean
'Filter available Parts
Set CurrentSearchCell = Range("PartDescriptions").Offset(1, 0)
Set CurrentFilteredListCell = Range("FilteredItemsStart")
SearchString1 = CurrentSearchCell.Text & " " & CurrentSearchCell.Offset(1, 0).Text
SearchString2 = TextBoxSearchItemList
Do
Check1 = SearchString1 Like "*" & SearchString2 & "*"
If Check1 = True And Not TextBoxSearchItemList = Empty Then
CurrentFilteredListCell = CurrentSearchCell
CurrentFilteredListCell.Offset(0, 1) = CurrentSearchCell.Offset(0, 1)
Set CurrentFilteredListCell = CurrentFilteredListCell.Offset(1, 0)
Set CurrentSearchCell = CurrentSearchCell.Offset(1, 0)
Else
Set CurrentSearchCell = CurrentSearchCell.Offset(1, 0)
End If
Loop Until CurrentSearchCell = Empty
End Sub