ich benötige Hilfe.
In den ersten 4 Stellen eines Strings kann
entweder 1 einzelnes Leerzeichen oder mehrere
aufeinander folgende Leerzeichen auftreten.
Ich möchte diese, jedoch nur im Bereich der 1.Stelle bis
zur 4.Stelle von links entfernen.
Als Ergebnis soll ein Textzeichen an 1. Stelle stehen.
Danke Peter
Sub LeerzRaus()
Dim strInhalt As String, lngZ1 As Long, lngZn As Long, lngZ As Long
Dim intS As Integer, intI As Integer, intZ As Integer
intS = 6 'Spalte F
lngZ1 = 2 'Erste Zeile
lngZn = 65536 'Letzte Zeile
Application.ScreenUpdating = False
Set wshFiles = Worksheets("Test")
With wshFiles
For lngZ = lngZ1 To lngZn
strInhalt = .Cells(lngZ, intS)
For intI = 1 To Len(strInhalt)
' intZ = Asc(Mid(strInhalt, intI, 1))
' If intZ = 32 intZ = Asc(Mid(strInhalt, 5, 4)
Next
.Cells(lngZ, intS) = strInhalt
Next
End With
Application.ScreenUpdating = True
End Sub