Problem using the INSTR function in VBA

  • Thread starter Thread starter raymond.allan
  • Start date Start date
R

raymond.allan

Hi,

Using Excel 2000

In the code below, INSTR is returning a value of 1 if the cell is
BLANK, is this correct or am I coding it wrong ?

t1 = 0
cCode=Range("J" & n)
Crit = "FLAR,ARPN,ARPG,ARPO,BINN,BING"

If InStr(Crit, cCode) > 0 Then t1 = 1

If Range("D" & n) = 7 And t1 = 0 Then
Range("Item_Errors!A" & rn) = Range("A" & n)
Range("Item_Errors!B" & rn) = Range("D" & n)
Range("Item_Errors!C" & rn) = Range("H" & n)
rn = rn + 1
End If

TIA for any help on this

Rgds
Raymond
 
Raymond,
Check the help. It states what happens if String2="".
Hint: It is returning the correct value according to the documentation,
although maybe not what you expect.

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top