Microsoft Office Tutorials and References
In Depth Information
9.3.3 Import von Tabellen aus Word
Abbildung 9.18
Word-Tabelle, die importiert werden soll
Sub WordTabelleImport()
Dim appWord As Word.Application
Dim i As Integer, k As Integer
Dim tb As Word.Table
Dim tx As String
ThisWorkbook.Worksheets("Tabelle2").Activate
' Anwendung Word starten
Set appWord = CreateObject("Word.Application")
' Word-Dokument öffnen
appWord.Documents.Open ThisWorkbook.Path _
& "\eindaten.docx"
' Erste Tabelle zuweisen
Set tb = appWord.ActiveDocument.Tables(1)
Fori=1Totb.Rows.Count
Fork=1Totb.Columns.Count
' Text einer Tabellenzelle inkl. Zellenende
tx = tb.Cell(i, k).Range.Text
' Zellenende löschen, Text in Zelle schreiben
Cells(i, k).Value = Left(tx, Len(tx) – 2)
Next k
Next i
Search JabSto ::




Custom Search