Re: Textfeld alle 72 Zeichen mit ENTER versehen
12.12.2002 13:21:09
Ramses
hallo Michaeldieses Makro teilt jeden Zellinhalt in Spalte A auf 72 Zeichen auf.
Sub Divide_at_72_Characters()
Dim myOStr As String, myNStr As String
Dim i As Integer, ii As Integer
Dim Cr As Long, Cc As Integer
Cr = 65536
'1 = Spalte A
Cc = 1
If Cells(Cr, Cc) = "" Then
Cr = Cells(Cr, Cc).End(xlUp).Row
End If
myNStr = ""
For i = 1 To Cr
myOStr = Cells(Cr, Cc).Value
For ii = 1 To Len(myOStr) Step 72
myNStr = myNStr & Mid(myOStr, ii, 72) & vbCrLf
Next ii
Cells(Cr, Cc) = myNStr
Next i
End Sub
Code eingefügt mit Syntaxhighlighter 1.12
Gruss Rainer