silentwolf
Well-known Member
- Joined
- May 14, 2008
- Messages
- 1,216
- Office Version
- 2016
Hello guys,
now I would need some helping hands with following UDF.
So how can I test this code, what strOld array is used when I step through the code using F8
The reason behind this is that mostly the function replace how it intend to but with one case it replace the strText not the way I want it.
So I was trying to step through the code but not really find what array is used if the strText contains one of the strOld within the strText.
Hope I did explain this good enough and someone can give me a hint on that.
I guess it should be a watch added or? But with the watch I still was not sure how to find when it was driggert.
Or how to look for it correctly.
Many thanks
now I would need some helping hands with following UDF.
Code:
Function ReNrAendern(ByVal strText As String) As String
Dim strOld(0 To 11) As Variant
Dim strNew As String
Dim i As Integer
strOld(0) = "RE "
strOld(1) = "RE. "
strOld(2) = "RE: "
strOld(3) = "Re "
strOld(4) = "Re. "
strOld(5) = "Re: "
strOld(6) = "Rg "
strOld(7) = "Rg. "
strOld(8) = "Rg: "
strOld(9) = "RG "
strOld(10) = "RG. "
strOld(11) = "RG: "
strNew = "RNR. "
For i = LBound(strOld) To UBound(strOld)
strText = Replace(strText, strOld(i), strNew)
Next i
ReNrAendern = strText
End Function
So how can I test this code, what strOld array is used when I step through the code using F8
The reason behind this is that mostly the function replace how it intend to but with one case it replace the strText not the way I want it.
So I was trying to step through the code but not really find what array is used if the strText contains one of the strOld within the strText.
Hope I did explain this good enough and someone can give me a hint on that.
I guess it should be a watch added or? But with the watch I still was not sure how to find when it was driggert.
Or how to look for it correctly.
Many thanks
Last edited: