View Single Post
 
Old 12-12-2013, 03:43 PM
OTPM OTPM is offline Windows 7 32bit Office 2010 32bit
Expert
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default Help with a UDF needed

Hi
I was provided with a UDF by Macropod a couple of years ago which I need modifying. Basically I need the UDF modified. The UDF basically converts values like "365SS+4wks, 175" to "365, 175". Where I need the UDF changed is allow values such as "23,456,567,666" to remain as shown. Here is a copy of the UDF:
Code:
Function ParseIt(StrIn As Variant) As Variant
Dim i As Long, j As Long, k As Long
Dim StrTmp As String, StrOut As String
For i = 0 To UBound(Split(StrIn, ","))
  StrTmp = Split(Split(Split(StrIn, ",")(i), "+")(0), "-")(0)
  k = Len(StrTmp)
  For j = k To 1 Step -1
    If Not IsNumeric(Mid(StrTmp, j, 1)) Then
      StrTmp = Replace(StrTmp, Mid(StrTmp, j, 1), "")
    End If
  Next
  StrOut = StrOut & StrTmp & ","
Next
ParseIt = Left(StrOut, Len(StrOut) - 1)
End Function
Any help appreciated.
Tony
Reply With Quote