use search
e.g. SEARCH("mary's lamb",A8,1)
If the text is contained in the cell, it will return its position
Hi All
I'm trying to create an Excel macro that will look in a cell's contents and identify which (out of many) phrases it contains.
For example, look in cell and see if
=baa baa black sheep or,
=mary's lamb or,
=three blind mice
are within that cell - anywhere in that cell.
I'm sure that left, mids, right would do the job. But with the text being possibly anywhere in the cell - can't quite figure out the macro code.
Would appreciate any assistance.
use search
e.g. SEARCH("mary's lamb",A8,1)
If the text is contained in the cell, it will return its position
I used to have an open mind but my brains kept falling out.
Cheers,
but does this work in a macro? I can get it to work fine as a formula but can't get it to work in a macro?
Thanks
I don't know - maybe you can click on 'record macro', and type the code into the cell and then look at the macro to get the code?
I used to have an open mind but my brains kept falling out.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks