bobkap
Active Member
- Joined
- Nov 22, 2009
- Messages
- 323
- Office Version
- 365
- Platform
- Windows
- Mobile
- Web
As part of an Excel macro, I'm trying to find if a string has a specific word in it and then, if it does, copy the string to another cell without some of the words in the cell.
I've tried this (below) which works ok, BUT if the address you see below is not EXACTLY the same which is often the case with a moved space or a deleted comma etc, the trim function will not work of course. I know there must be a way to do some kind of wildcard solution, but darned if I can figure it out.
Here's what I've tried so far:
grape = Cells(mirow, micol)
If InStr(grape, "San Ramon") Then
bk = Trim(Replace(grape, "(211 Old Crow Canyon Rd#19, San Ramon Ca 94583)", " "))
Cells(mirow, micol +1) = bk
Any help would be very greatly appreciated.
I've tried this (below) which works ok, BUT if the address you see below is not EXACTLY the same which is often the case with a moved space or a deleted comma etc, the trim function will not work of course. I know there must be a way to do some kind of wildcard solution, but darned if I can figure it out.
Here's what I've tried so far:
grape = Cells(mirow, micol)
If InStr(grape, "San Ramon") Then
bk = Trim(Replace(grape, "(211 Old Crow Canyon Rd#19, San Ramon Ca 94583)", " "))
Cells(mirow, micol +1) = bk
Any help would be very greatly appreciated.
Last edited: