Sarah12345
New Member
- Joined
- Jun 29, 2022
- Messages
- 2
- Platform
- Windows
Hi All,
I would like to add a wild card to help filter my results in case a user types in a word slightly differently, for example if a the data contains 'Van' or 'VAN' or 'Van 01' I would like to return all of those results.
Is there any way to add in a wildcard to help with this so I don't need to type out all of the variations?
Sheets("Raw_Data").Select
' Find the last row of data
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
' Loop through each row
For x = 1 To FinalRow
' Decide if to copy based on column A
ThisValue = Cells(x, 1).Value
If (ThisValue = "Van" Or ThisValue = "van" Or ThisValue = "Lorry" Or ThisValue = "lorry") Then
Cells(x, 1).Resize(1, 33).Copy
Sheets("Vehicle").Select
NextRow = Cells(Rows.Count, 1).End(xlUp).Row + 1
Cells(NextRow, 1).Select
ActiveSheet.Paste
Sheets("Raw_Data").Select
End If
Next x
I would like to add a wild card to help filter my results in case a user types in a word slightly differently, for example if a the data contains 'Van' or 'VAN' or 'Van 01' I would like to return all of those results.
Is there any way to add in a wildcard to help with this so I don't need to type out all of the variations?
Sheets("Raw_Data").Select
' Find the last row of data
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
' Loop through each row
For x = 1 To FinalRow
' Decide if to copy based on column A
ThisValue = Cells(x, 1).Value
If (ThisValue = "Van" Or ThisValue = "van" Or ThisValue = "Lorry" Or ThisValue = "lorry") Then
Cells(x, 1).Resize(1, 33).Copy
Sheets("Vehicle").Select
NextRow = Cells(Rows.Count, 1).End(xlUp).Row + 1
Cells(NextRow, 1).Select
ActiveSheet.Paste
Sheets("Raw_Data").Select
End If
Next x