I have a string that is suppose to be a word code. It includes two letters followed by a number(s).
I'm trying to determine which combinations of word code are all in that string. I'm separating out the letters by putting each word/numbers in a array but i'm stuck at how would i know if for example 16-28 means all numbers between 16 through 28.
Here's my code :
Dim arrayString() As String
arrayString = Split("MH12, MH13, MH16-28").Value, ",")
For i = 0 To UBound(arrayString)
msgString = arrayString(i) & vbCr
Next i
Output I need to be able to determine should be :
MH12, MH13, MH16, MH17, MH18, MH19, MH20, MH21, MH22, MH23, MH24, MH25, MH26, MH27, MH28
Here is a function which you might find useful:
For example, in the Immediate Window:
And also (note the space after the comma):