Gruppe
Dialog
Problem
Die Spalten A und C sollen in einer UserForm-ListBox linksbündig, Spalte B rechtsbündig dargestellt werden.
ClassModule: frmAlign
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub UserForm_Initialize()
Dim arr(1 To 10, 1 To 3)
Dim iRow As Integer, iCol As Integer
For iRow = 1 To 10
For iCol = 1 To 3
If iCol = 2 Then
arr(iRow, iCol) = String(8 - _
Len(Cells(iRow, iCol).Text), " ") & _
Cells(iRow, iCol).Text
Else
arr(iRow, iCol) = Cells(iRow, iCol)
End If
Next iCol
Next iRow
lstAlign.List = arr
End Sub
StandardModule: Modul1
Sub CallForm()
frmAlign.Show
End Sub