Hi,
I'm working in a Excel Macro, in which the following Instr function taking up the text string(Johan) as partial
but I need to make it as a whole.
For example in cell A1 the text string is "Johan, James, Jason, Johan" for this case the function works fine and returning the value "Johan" in B2
but in Cell A2 the text string is "Johan_VK, Roger" for this case also the function returning the value "Johan" in B2 this is not correct.
could anyone help to improve this Instr section to search as whole text
Regards,
Vino
I'm working in a Excel Macro, in which the following Instr function taking up the text string(Johan) as partial
but I need to make it as a whole.
VBA Code:
If Instr(Cell.value, "Johan,") >0 Or _
Instr(Cell.value, "Johan") >0 Then
cell.offset(0,2).value = "Johan"
For example in cell A1 the text string is "Johan, James, Jason, Johan" for this case the function works fine and returning the value "Johan" in B2
but in Cell A2 the text string is "Johan_VK, Roger" for this case also the function returning the value "Johan" in B2 this is not correct.
could anyone help to improve this Instr section to search as whole text
Regards,
Vino