sthrncaliguy
Board Regular
- Joined
- Jul 28, 2009
- Messages
- 213
I am working on a macro that isolates rows that contain a specific number in one column. The number could be anything from 0 to 5. There is a userform where the user can select any combination of numbers from 0-5 to search for, and I am buildling a Variable String based on those check boxes...
So the variable might look like this: NumberStr = 01345, or
NumberStr = 135, or any other combination of 0, 1, 2, 3, 4, and 5.
What I need help with is the syntax to compare a cell value to that string.. So if the cell has a 1, 2, 3, 4, or 5 in it, and the String had a 0,1,2,3,4, or 5 in it, that cell would result in a True statement for VBA purposes.
I was thinking there was some type of InStr or [Character] function in VB, but I am having trouble locating any good examples showing the proper syntax to accomplish this.
Any help is appreciated.
So the variable might look like this: NumberStr = 01345, or
NumberStr = 135, or any other combination of 0, 1, 2, 3, 4, and 5.
What I need help with is the syntax to compare a cell value to that string.. So if the cell has a 1, 2, 3, 4, or 5 in it, and the String had a 0,1,2,3,4, or 5 in it, that cell would result in a True statement for VBA purposes.
I was thinking there was some type of InStr or [Character] function in VB, but I am having trouble locating any good examples showing the proper syntax to accomplish this.
Any help is appreciated.