Hey everyone,
I have a piece of code that is frustrating because I have no idea why it is not working as intended. I basically have a string that I need to split on a delimiter, ":". When I split it into the array, the array is empty. Here is the code.
The string LastTextRange is what should contain a ":", and it does sometimes. If it does it falls into the if statement and rangeSplit should contain the values on either side of the ":". ANy help would be appreciated, thanks!
I have a piece of code that is frustrating because I have no idea why it is not working as intended. I basically have a string that I need to split on a delimiter, ":". When I split it into the array, the array is empty. Here is the code.
Code:
If InStr(1, LastTextRange, ":", 1) > 0 Then
Dim rangeSplit() As String
rangeSplit() = Split(CStr(LastRangeText), ":")
Application.EnableEvents = False
Application.Undo
Application.EnableEvents = True
Exit Sub
End If
The string LastTextRange is what should contain a ":", and it does sometimes. If it does it falls into the if statement and rangeSplit should contain the values on either side of the ":". ANy help would be appreciated, thanks!