Well people, not one has posted a solution so I went ahead and created it.
So for those of you who are interested, the function can be found below.
Code:
''' <summary>
''' Function used to break a ranged string apart into individual values which are the returned in a collection
''' If use this function, please leave this header in :)
''' </summary>
''' <param name="StringToParse">Ranged String to break apart eg. 1-5,10,21,25-30</param>
''' <author>Dredix</author>
Private Function ParseRangeString(ByVal StringToParse As String) As Collection
Dim split As String() = StringToParse.Split(",") 'Breaking the string apart by "," into array
Dim vOutValues As New Collection 'Declaring a new collection
Dim vRaneCNT, vColLCNT As Integer 'Used as counter
Try 'Incase of error
For Each s As String In split 'Looping through array for values and range
If s.Trim() <> "" Then 'Ensuring string is not empty
If InStr(s, "-") Then 'Testing if string is a Range
For vRaneCNT = CInt(s.Substring(0, InStr(s, "-") - 1)) To CInt(s.Substring(InStr(s, "-"))) 'Determine Range to loop
For vColLCNT = 1 To vOutValues.Count 'Ensuring the value is not already in the collection
If CInt(vOutValues.Item(vColLCNT)) = CInt(vRaneCNT) Then GoTo NextRangeValue 'Jump over adding to collection
Next
vOutValues.Add(CInt(vRaneCNT)) 'Adding value in Range to collection
NextRangeValue:
Next
Else
For vColLCNT = 1 To vOutValues.Count 'Ensuring the value is not already in the collection
If CInt(vOutValues.Item(vColLCNT)) = CInt(s) Then GoTo NextValue 'Jump over adding to collection
Next
vOutValues.Add(CInt(s)) 'Adding value to collection
NextValue:
End If
End If
Next s
Return vOutValues 'Returning Collection
Catch ex As Exception
Return vOutValues 'Returning Collection
End Try
End Function