Bueno no se porque pero esto me esta modificando la variable Expre ssion (lo separe para que no lo modifique) por epresionje
Código
'--------------------------------------------------------------------------------------- ' Procedure : SplitAlter ' DateTime : 16/09/2008 22:58 ' Author : Cobein ' Mail : cobein27@yahoo.com ' Purpose : Complete Split Replacement '--------------------------------------------------------------------------------------- Private Function SplitAlter(ByVal epresionje As String, Optional ByVal Delimiter As String, Optional ByVal Limit As Long = -1) As String() Dim lLastPos As Long Dim lIncrement As Long Dim lExpLen As Long Dim lDelimLen As Long Dim lUbound As Long Dim svTemp() As String lExpLen = Len(epresionje) If Delimiter = vbNullString Then Delimiter = " " lDelimLen = Len(Delimiter) If Limit = 0 Then GoTo QuitHere If lExpLen = 0 Then GoTo QuitHere If InStr(1, epresionje, Delimiter, vbBinaryCompare) = 0 Then GoTo QuitHere ReDim svTemp(0) lLastPos = 1 lIncrement = 1 Do If lUbound + 1 = Limit Then svTemp(lUbound) = Mid$(epresionje, lLastPos) Exit Do End If lIncrement = InStr(lIncrement, epresionje, Delimiter, vbBinaryCompare) If lIncrement = 0 Then If Not lLastPos = lExpLen Then svTemp(lUbound) = Mid$(epresionje, lLastPos) End If Exit Do End If svTemp(lUbound) = Mid$(epresionje, lLastPos, lIncrement - lLastPos) lUbound = lUbound + 1 ReDim Preserve svTemp(lUbound) lLastPos = lIncrement + lDelimLen lIncrement = lLastPos Loop ReDim Preserve svTemp(lUbound) SplitAlter = svTemp Exit Function QuitHere: ReDim SplitAlter(-1 To -1) End Function