Hi Bill
This will pull out all of the alphanumeric characters from the first one to
the last - e.g.
ab145 gives ab145
$@ab145 gives ab145
ab$@145 gives ab
$@ab$@145 gives ab
you can hack the alphanum function to allow / dis-allow whatever characters
that you want....
HTH
David
############################################
Function alphanum(letter As String)
Select Case (letter)
Case "a" To "z", "A" To "Z", 0 To 9: alphanum = True
Case Else: alphanum = False
End Select
End Function
Sub macro1()
Dim x, y As Integer
Dim tocheck, result As String
Dim done, doing, started As Boolean
x = 1
y = 1
done = False
doing = True
started = False
While (Range("A" & x).Value <> "")
y = 1
result = ""
tocheck = Range("A" & x).Value
While ((y <= Len(tocheck)) And (Not (done)))
If (alphanum(Mid(tocheck, y, 1))) Then
result = result & Mid(tocheck, y, 1)
started = True
Else
If (started) Then doing = False
End If
If (Not (doing)) Then done = True
y = y + 1
Wend
doing = True
done = False
started = False
Range("b" & x).Value = result
x = x + 1
Wend
End Sub
############################################