rround,

the following subroutine does what you want...

keep in mind, though, that there are some assumptions:

1) there's no error checking that the input string is

well-formed (always an alpha before the number, always

a dash for a range of numbers, etc)

2) i fill the listbox directly from the routine.

3) i don't check that the first number in the range is

less than or equal to the second.

let me know if you need more comments; here it is...

Public Sub ExpandNumbers(lstrSerial As String, ctlList As ListBox)

Dim Finished As Boolean

Dim iDashPosition As Integer

Dim iNumberPosition As Integer

Dim sTemp As String

Dim i As Integer

Dim sPrefix As String

Dim iLowBound As Integer

Dim iHighBound As Integer

'initialize temp variables

Finished = False

iDashPosition = Len(lstrSerial)

'search for the right-most dash character

While Not Finished

If Mid(lstrSerial, iDashPosition, 1) = "-" Then

Finished = True

Else

iDashPosition = iDashPosition - 1

End If

Wend

'find the position of the letter which precedes

'the number (e.g., "34030089 U110-115")

iNumberPosition = iDashPosition - 1

Finished = False

While Not Finished

sTemp = Mid(lstrSerial, iNumberPosition, 1)

If sTemp < "0" Or sTemp > "9" Then

Finished = True

Else

iNumberPosition = iNumberPosition - 1

End If

Wend

iLowBound = CInt(Mid(lstrSerial, iNumberPosition + 1, iDashPosition - iNumberPosition - 1))

iHighBound = CInt(Mid(lstrSerial, iDashPosition + 1, Len(lstrSerial) - iDashPosition))

'set up the strings' prefixes...

sPrefix = Left(lstrSerial, iNumberPosition)

For i = iLowBound To iHighBound

sTemp = sPrefix & CStr(i)

ctlList.AddItem (sTemp)

Next i

End Sub

the following subroutine does what you want...

keep in mind, though, that there are some assumptions:

1) there's no error checking that the input string is

well-formed (always an alpha before the number, always

a dash for a range of numbers, etc)

2) i fill the listbox directly from the routine.

3) i don't check that the first number in the range is

less than or equal to the second.

let me know if you need more comments; here it is...

Public Sub ExpandNumbers(lstrSerial As String, ctlList As ListBox)

Dim Finished As Boolean

Dim iDashPosition As Integer

Dim iNumberPosition As Integer

Dim sTemp As String

Dim i As Integer

Dim sPrefix As String

Dim iLowBound As Integer

Dim iHighBound As Integer

'initialize temp variables

Finished = False

iDashPosition = Len(lstrSerial)

'search for the right-most dash character

While Not Finished

If Mid(lstrSerial, iDashPosition, 1) = "-" Then

Finished = True

Else

iDashPosition = iDashPosition - 1

End If

Wend

'find the position of the letter which precedes

'the number (e.g., "34030089 U110-115")

iNumberPosition = iDashPosition - 1

Finished = False

While Not Finished

sTemp = Mid(lstrSerial, iNumberPosition, 1)

If sTemp < "0" Or sTemp > "9" Then

Finished = True

Else

iNumberPosition = iNumberPosition - 1

End If

Wend

iLowBound = CInt(Mid(lstrSerial, iNumberPosition + 1, iDashPosition - iNumberPosition - 1))

iHighBound = CInt(Mid(lstrSerial, iDashPosition + 1, Len(lstrSerial) - iDashPosition))

'set up the strings' prefixes...

sPrefix = Left(lstrSerial, iNumberPosition)

For i = iLowBound To iHighBound

sTemp = sPrefix & CStr(i)

ctlList.AddItem (sTemp)

Next i

End Sub