Is there a way in VBA to have the SEARCH function only pick up cells that includes the "exact" text instead of similar text?
04:17 24 Jan 2022

I'm trying to get VBA / Excel to label cells as a specific category based on the specific text that the cell contains.

Currently I'm using the following:

''' =IF(ISNUMBER(SEARCH(""fee"",RC[-5]))),""fee"","N/A") '''

For the majority of the cells included in my regular dataset, I am able to categorise cells that contains the text "fee" as "Fee", however, there are cases where the cell could include word like "Coffee" where "fee" is also included.

In that case, these cells will also be categorised as "fee" as well which is not desirable.

Is there a way to avoid this by adding more condition / codes?

excel vba