Praxistipps | Standardprozeduren | Microsoft-Text | Beispiele | Elemente |
Private Sub UserForm_Initialize() Dim rng As Range Set rng = Range("A1").CurrentRegion Dim iRow As Integer, iCol As Integer For iRow = 1 To rng.Rows.Count For iCol = 1 To rng.Columns.Count Spreadsheet1.Cells(iRow, iCol).Value = rng.Cells(iRow, iCol).Value Next iCol Next iRow End Sub
Private Sub CommandButton1_Click() Dim iRow As Integer, iCol As Integer iRow = 1 iCol = 1 With Spreadsheet1 Do Until IsEmpty(.Cells(iRow, iCol)) Do Until IsEmpty(.Cells(iRow, iCol)) Cells(iRow, iCol).Value = .Cells(iRow, iCol).Value iCol = iCol + 1 Loop iCol = 1 iRow = iRow + 1 Loop End With End Sub
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Repräsentiert die Kalkulationstabelle.
Verwenden des Spreadsheet-Objekts
Sie können entweder die CreateObject-Methode oder das Schlüsselwort New verwenden, um ein neues Spreadsheet-Objekt zu erstellen.
Die Objekt-ID eines Kalkulationstabellen-Steuerelements auf einer HTML-Seite oder in einem Visual Basic-Formular gibt ein Spreadsheet-Objekt zurück.
Der programminterne Bezeichner des Spreadsheet-Objekts lautet CLSID:0002E510-0000-0000-C000-000000000046
. Im nachfolgenden Beispiel wird auf einer HTML-Seite eine Kalkulationstabelle mit dem Namen "Spreadsheet1" erstellt.
<object id=Spreadsheet1 classid=CLSID:0002E510-0000-0000-C000-000000000046 style="width:49%;height:350"></object>
Die Beispiele zum Einsatz von SpreadSheets
![]() |
![]() |