View Single Post
 
Old 12-03-2020, 04:21 PM
robnun robnun is offline Windows 10 Office 2019
Novice
 
Join Date: Dec 2020
Location: TX, USA
Posts: 8
robnun is on a distinguished road
Default Count Unique Instances of Multiple Strings Using Wildcards

I am looking for a macro that will count the unique instances of multiple strings, and the find function requires wild cards.

Example: Assume the text in the Word document is: PE-15896 Blue lamps from China. PE-12 Green buckets from India. JEB-85968 Green cans from Mexico. HEL-698568 Orange phones from Peru. HEL-698568 Red boxes from Canada. (Notice HEL-698568 is used twice - this should be counted as one instance)
I need to count all instances of strings that start with PE-,HEL-, and JEB- and have any number of characters after the dash.

I need to generate the following:
PE-15896
PE-12
JEB-85968
HEL-698568
Total Unique Records = 4

Thank you!

Last edited by robnun; 12-03-2020 at 06:53 PM.
Reply With Quote