vendredi 25 mai 2018

If not value between does not work. VBA in excel

I have used Stackoverflow to solve a lot of problems but this one I can´t find the answer to. If not state is not true, ever but even when it should be.

for i = 1 to 2
   Value=.Range("N" & i).Value 'Value is 0 for example

   Msgbox(Value) 'to debug what the value is and this example it is 0

   If not (300<=Value<=500) then 'this statement is never true even if Value=0
       'Do stuff
   End If

next i

Aucun commentaire:

Enregistrer un commentaire