Log in

View Full Version : [SOLVED:] Wildcard Search Including Special Characters



mellowest
04-04-2018, 12:53 PM
Hello,

Would it be possible to have a wildcard search to handle the following?

70402 Landpiper Dr Apt 27, DauLtan, Tx 77092-4542, DarriL (Jan2074-Feb2078)
70402 Landpiper Dr Apt 720, DauLtan, Tx 77092-4550, DarriL (Aug2072-DeP2072)

The bold section between, including the hyphen and the closing parentheses should be deleted. Any assistance would be appreciated.

Thank you.

gmaxey
04-04-2018, 02:29 PM
You don't need VBA for that. Just search for: -*\) and replace with nothing.

macropod
04-04-2018, 03:58 PM
I'd probably go for a wildcard Find/Replace with:
Find = -[0-9]{4}*\)
Replace = nothing
just so as to avoid false matches with hyphens earlier in the string (e.g. 70402 Landpiper-Smith Dr Apt 27, DauLtan, Tx 77092-4542, DarriL (Jan2074-Feb2078))

mellowest
04-06-2018, 05:44 AM
Thank you Greg and Paul. I started seriously trying learn VBA about 1.5 months ago and thanks to this forum, I am miles away from where I started (low bar, but still).

Seriously wish I could buy you guys beers.

gmaxey
04-06-2018, 05:52 AM
You're welcome. I would seriously enjoy one!