Thema Datum  Von Nutzer Rating
Antwort
21.01.2016 17:45:06 Harun Deniz
NotSolved
Blau Word Tabellen in Excel kopieren
21.01.2016 19:24:44 Gast16694
NotSolved
21.01.2016 19:32:56 Harun Deniz
NotSolved
21.01.2016 19:43:53 Gast12213
NotSolved
21.01.2016 21:47:55 Gast27527
NotSolved
23.01.2016 09:59:30 Harun Deniz
Solved
23.01.2016 10:16:32 Gast28215
NotSolved
24.01.2016 11:30:26 Harun Deniz
NotSolved

Ansicht des Beitrags:
Von:
Gast16694
Datum:
21.01.2016 19:24:44
Views:
742
Rating: Antwort:
  Ja
Thema:
Word Tabellen in Excel kopieren

hier nur erstmal dein Code zum Mitlesen.

 

Option Explicit
Sub ImportWordTable()

Dim wdDoc As Object
Dim wdFileName As Variant
Dim tableNo As Integer 'table number in Word
Dim iRow As Long 'row index in Excel
Dim iCol As Integer 'column index in Excel
Dim resultRow As Long
Dim tableStart As Integer
Dim tableTot As Integer

On Error Resume Next

ActiveSheet.Range("A:AZ").ClearContents
wdFileName = Application.GetOpenFilename("Word files (*.doc),*.doc", , "Browse for file containing table to be imported")
If wdFileName = False Then Exit Sub '(user cancelled import file browser)

Set wdDoc = GetObject(wdFileName)
'open Word file
With wdDoc
tableNo = wdDoc.tables.Count
tableTot = wdDoc.tables.Count

If tableNo = 0 Then
    MsgBox "This document contains no tables", vbExclamation, "Import Word Table"
ElseIf tableNo > 1 Then
    tableNo = InputBox("This Word document contains " & tableNo & " tables." & vbCrLf & "Enter the table to start from", "Import Word Table", "1")
End If

resultRow = 4

For tableStart = 1 To tableTot
    With .tables(tableStart) 'copy cell contents from Word table cells to Excel cells
    For iRow = 1 To .Rows.Count
        For iCol = 1 To .Columns.Count
            Cells(resultRow, iCol) = WorksheetFunction.Clean(.cell(iRow, iCol).Range.Text)
        Next iCol
        resultRow = resultRow + 1
    Next iRow
    End With
    resultRow = resultRow + 1
Next tableStart

End With 

 


Ihre Antwort
  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen
Thema: Name: Email:



  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen

Thema Datum  Von Nutzer Rating
Antwort
21.01.2016 17:45:06 Harun Deniz
NotSolved
Blau Word Tabellen in Excel kopieren
21.01.2016 19:24:44 Gast16694
NotSolved
21.01.2016 19:32:56 Harun Deniz
NotSolved
21.01.2016 19:43:53 Gast12213
NotSolved
21.01.2016 21:47:55 Gast27527
NotSolved
23.01.2016 09:59:30 Harun Deniz
Solved
23.01.2016 10:16:32 Gast28215
NotSolved
24.01.2016 11:30:26 Harun Deniz
NotSolved