If you often write complex string-parsing and manipulation algorithms, the last thing you want is to add more checks to ensure your string positions are not negative. Avoid the hassle by using this function when you need to use Mid. It wraps around native VB functionality and handles this common error case:
Public Function FlexiMid(From As String, ByVal Start _ As Long, Optional Length As Long = -1) As String If Start
Once you paste this function into your program?I recommend a module, so you can access it from anywhere?you can use it as you would Mid. In fact, once I wrote this, I ran a search-and-replace on my project to start using it throughout.