Gruppe
Dialog
Problem
In eine UserForm-ComboBox sollen die in Spalte M genannten Spalten eingelesen werden.
ClassModule: frmColumns
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub UserForm_Initialize()
Dim arr() As Variant
Dim iRow As Integer, iCol As Integer, iRowL As Integer, iColL As Integer
iRowL = WorksheetFunction.CountA(Columns(1))
iColL = WorksheetFunction.CountA(Columns(13))
ReDim arr(1 To iRowL, 1 To iColL)
For iRow = 1 To iRowL
For iCol = 1 To iColL
arr(iRow, iCol) = Cells(iRow, Cells(iCol, 13).Value)
Next iCol
Next iRow
With cboColumns
.ColumnCount = iColL
.List = arr
.ListIndex = 0
End With
End Sub
StandardModule: Modul1
Sub CallForm()
frmColumns.Show
End Sub