if Not Instr() Issue

ilcaa

Well-known Member
Joined
May 25, 2005
Messages
751
Office Version
  1. 365
Platform
  1. Windows
I cant see what the issue is with this if Not statement, it continues the IF statement even though it shouldnt. right??

b = "Just Listed"

If Not InStr(1, b, "Listed", 1) Then
msgbox "Not New"
End If

Loop
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
yes that worked!

is that just a bug with vba using NOT Instr(), or it shouldnt be used like that??

thanks!
 
Upvote 0
I don't think that you can use Not like that in a test for a numeric result in VBA. Not works fine when the result of a test is True or False.
 
Upvote 0

Forum statistics

Threads
1,223,652
Messages
6,173,606
Members
452,522
Latest member
saeedfiroozei

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top