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

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
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,833
Messages
6,121,865
Members
449,052
Latest member
Fuddy_Duddy

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