Gruppe
Dialog
Problem
Wie kann ich ein Tabellenblatt mit Zeilen und Spalten in eine Userform übernehmen?
ClassModule: Tabelle3
Private Sub CommandButton1_Click()
ActiveCell.Select
frmUserTable.Show
End Sub
StandardModule: basMain
Sub CallForm()
frmSpreadsheet.Show
End Sub
ClassModule: frmSpreadsheet
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
Dim iRow As Integer, iCol As Integer
For iRow = 1 To 5
For iCol = 1 To 4
Cells(iRow, iCol).Value = _
Spreadsheet1.Cells(iRow, iCol).Value
Next iCol
Next iRow
End Sub
Private Sub UserForm_Initialize()
Dim iRow As Integer, iCol As Integer
For iRow = 1 To WorksheetFunction.CountA(Columns(1))
For iCol = 1 To WorksheetFunction.CountA(Rows(1))
Spreadsheet1.Cells(iRow, iCol).Value = _
Cells(iRow, iCol).Value
Next iCol
Next iRow
End Sub