Substring in VBA
Test for ':' first, then take test string up to ':' or end, depending on if it was found
Dim strResult As String' Position of :intPos = InStr(1, strTest, ":")If intPos > 0 Then ' : found, so take up to : strResult = Left(strTest, intPos - 1)Else ' : not found, so take whole string strResult = strTestEnd If