I have a list of adresses that i need to clean up.
The goal is to add a space before the numbers as shown in below examples.
16AVCHARLESDAGAULLECS10525 16 Avcharlesdagaullecs 10525
1BDHIPPOLYTEMARQUES 1 Bdhippolytemarques
20GARRICKSTREET4THFLOOR 20 Garrickstreet 4Thfloor
2109ZAC 2109 Zac
2-4VANDRIESSTREET4 2-4 Vandriesstreet 4
5:ETVÄRG.19.E 5:Etvärg. 19.E
901ACEHIGHENTTOWE9TH233 901 Acehighenttowe 9Th 233
I have found a script that puts spaces in between letters but that is not my goal. Here is the code I have so far. It does not give the result abowe.
Function Add_Spaces(ByVal sText As String) As String
Dim CharNum As Long
Dim FixedText As String
Dim CharCode As Long
FixedText = Left(sText, 1)
For CharNum = 2 To Len(sText)
CharCode = Asc(Mid(sText, CharNum, 1))
If CharCode >= 65 And CharCode <= 90 Then
FixedText = FixedText & " " & Mid(sText, CharNum, 1) 'This needs to be rewritten
Else
FixedText = FixedText & Mid(sText, CharNum, 1)
End If
Next CharNum
Add_Spaces = FixedText
End Function
Do you have any idea on how i can solve this?
Here is a solution for regex that might give a lead: R separate words from numbers in string

