AW: Mehrzeiligen Text in Tabelle oder aus Tabelle
10.07.2019 08:48:45
Torsten
Hallo Sigi,
ich wuerde beim Listbox fuellen ganz einfach in jede Zelle, die eingelesen wird, vorher wieder ein Leerzeichen anhaengen. Hab die Zeile, die ich eingefuegt habe, fett markiert. Hoffe man sieht es:
Sub lst_fuellen()
Dim sB As String
Dim lxx As Integer
Dim iRowU As Integer
Dim iRow As Integer
Dim arr() As Variant
Dim x As Variant
Set wksE = ThisWorkbook.Worksheets("Erstellen")
wksE.Cells.EntireColumn.AutoFit
With UF1
'Spaltenbreite festlegen
For lZe = 1 To 6
sB = sB & ";" & wksE.Columns(lZe).Width
Next
With .lstAng_Pos
.Clear
.ColumnWidths = Mid$(sB, 2)
.ColumnCount = 6
For iRow = 2 To wksE.Cells(Rows.Count, 4).End(xlUp).Row
If Not IsEmpty(wksE.Cells(iRow, 4)) Then
ReDim Preserve arr(0 To 5, 0 To iRowU)
wksE.Cells(iRow, 4).Value = wksE.Cells(iRow, 4).Value & " "
arr(0, iRowU) = wksE.Cells(iRow, 1)
arr(1, iRowU) = wksE.Cells(iRow, 2)
arr(2, iRowU) = wksE.Cells(iRow, 3)
arr(3, iRowU) = wksE.Cells(iRow, 4)
arr(4, iRowU) = wksE.Cells(iRow, 5)
arr(5, iRowU) = wksE.Cells(iRow, 6)
iRowU = iRowU + 1
End If
Next iRow
If iRowU > 0 Then .Column = arr
End With
End With
End Sub
Gruss Torsten