VBA SEARCH IN STRING INSTR CASE INSENSITIVE

http://didenko.ca/blog/wp-content/plugins/syntax-highlighter-compress/scripts/shBrushVb.js

InStr specification:
Instr( [start], string, substring, [compare] )

MsgBox InStr("Hi there", "THERE")
' will return 0, as "THERE" doesn't match the case:

' use vbTextCompare to make the search case insensitive:
MsgBox InStr(1, "Hi there", "THERE", vbTextCompare)
' will return 4

Leave a comment

Design a site like this with WordPress.com
Get started