comparing cell values to wildcards in a string?

robfritts

New Member
Joined
Apr 28, 2002
Messages
18
I'm looking for a VBA argument to help me define criteria. I tried the conditional formatting, but I can't figure out how to type this formula. I want to ClearContents or DeleteRow for any cell value that is not in for format ##XXXXXX, where # is any numeric and X is any alpha character. I also want to do conditional formatting and highlight a cell if the criteria is "xxxxxxCEx3T" where
x is any alpha character. Am I just not finding the right wildcards to do this or using the wrong format/argument?

In case you couldn't tell, I'm new. :)
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Use the Like Operator
<pre>

MatchPattern = YourValue Like "##??????"
'if MatchPatter = False then delete your row
MatchPattern = YourValue Like "??????CE?3T"
'if MatchPatter = True then do your formatting

</pre>
Tom
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,545
Members
449,089
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top