4 Tricks in Excel for Business

Trick 1 - Instr( ) - strings vba

a = "ABCDE"
debug.print instr(a,"D")


Function that finds the position of one string within another string. Returns 0 if not found.

Can also pass the starting location.

instr(start,look_in, look_for)

Doesn't handle upper/lower case issues unless you specify. I use lcase function and test for lower case characters.

debug.print instr(lcase(a),"d")

Google on VBA Instr

Backlog (#cnt) | Table of Contents | Send us your feedback | Random | © 2019 All Rights Reserved