Im trying to use the Instr function to check wheteher a cell contains either of 2 values "GBP" or "GBR". Below is my code which I thought was correct but even when I am 100% sure the cell contains one of these values and I checked Length of value and it is 3, still I am getting False.
If InStr(.Cells(1, intStartRow, cVWAP_CURR_COL).Value, "GBR") = True Or _
InStr(.Cells(1, intStartRow, cVWAP_CURR_COL).Value, "GBP") = True Then
pboolBritain_GBP = True
End If
I am puzzled as to what is wrong because I have used Instr before and never had this problem.
Can anyone see anything wrong with this code or any ideas where I may be going wrong.
Thanks for any help
If InStr(.Cells(1, intStartRow, cVWAP_CURR_COL).Value, "GBR") = True Or _
InStr(.Cells(1, intStartRow, cVWAP_CURR_COL).Value, "GBP") = True Then
pboolBritain_GBP = True
End If
I am puzzled as to what is wrong because I have used Instr before and never had this problem.
Can anyone see anything wrong with this code or any ideas where I may be going wrong.
Thanks for any help