silentwolf
Well-known Member
- Joined
- May 14, 2008
- Messages
- 1,216
- Office Version
- 2016
Hi guys,
I am struggling again gg../
Following code works if I am not using it within my code..
When I run it from another code it delets the remaining records ..(
So I guess there need to be a redim preserve in it .. but in my case how does this one need to be??
Many thanks as always
I am struggling again gg../
Code:
Function MandatLoeschen(ByVal strText As String) As String
Dim strSearch As String
Dim varWoerter As Variant
Dim lngCounter As Long
Dim strMandat As String
strSearch = "Mandatsnummer:"
varWoerter = Split(strText, " ")
For lngCounter = LBound(varWoerter) To UBound(varWoerter)
If varWoerter(lngCounter) = strSearch Then
MandatLoeschen = varWoerter(lngCounter) & " " & varWoerter(lngCounter + 1)
MandatLoeschen = Replace(strText, MandatLoeschen, "")
Else
End If
Next lngCounter
End Function
Following code works if I am not using it within my code..
When I run it from another code it delets the remaining records ..(
So I guess there need to be a redim preserve in it .. but in my case how does this one need to be??
Many thanks as always