cortexnotion
Board Regular
- Joined
- Jan 22, 2020
- Messages
- 150
- Office Version
- 2013
- Platform
- Windows
Hi All
I am stuck with how to search a complex string that has so many wildcards. The string format is always "B?W/?????/??/??" or "H?W/?????/??/??" where the question marks are always a number, the "B" or "H" are the constant values in 1st character of string, "W" is always 3rd character, and the string can appear anywhere in the cell and may not always have a space before and/or after it.
As an example I was thinking...
but that doesn't seem to work.
Any help appreciated on how to detect the string!
I am stuck with how to search a complex string that has so many wildcards. The string format is always "B?W/?????/??/??" or "H?W/?????/??/??" where the question marks are always a number, the "B" or "H" are the constant values in 1st character of string, "W" is always 3rd character, and the string can appear anywhere in the cell and may not always have a space before and/or after it.
As an example I was thinking...
VBA Code:
If Sheets(1).Range("A1") = "*B?W/?????/??/??*" then Msgbox "Match"
but that doesn't seem to work.
Any help appreciated on how to detect the string!
Project 1 B6W/12765/01/02 Road repair |
H6W/12483/01/17 Project 2 unknown status |
approved Project 3 continue status |
Project 4 H6W/12483/01/18locked radio soon |
B6W/12765/01/04Project 5 further funding |
Project 6 aborted report back |