Consulting

Results 1 to 4 of 4

Thread: Import Specific txt from Word to Excel

  1. #1

    Exclamation Import Specific txt from Word to Excel

    Hello, Im new to vba and trying for some days now of importing text from word do into excel..
    ive attached a word doc , the part i need to import into excel is

    Référence---------Désignation -------------Qté ---------Unité Ml

    Brut
    S590044 ----------RAIL CLIPPABLE -----------3barre -------5.80

    Thanks in advance
    Attached Files Attached Files

  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    Is the extraction for just one Word document, or for multiple Word documents?
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Knowledge Base Approver VBAX Wizard
    Joined
    Apr 2012
    Posts
    5,635
    Sub M_snb()
       ActiveDocument.SaveAs2 "G:\OF\test_001.csv", 2
       
       With CreateObject("Excel.application")
         .Visible = -1
         .DisplayAlerts = 0
         .workbooks.Open("G:\OF\test_001.csv").sheets(1).Columns(1).texttocolumns , , , , -1, 0, 0, 0, 0, 0
        End With
    End Sub

  4. #4
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    Somehow I doubt the OP wants the whole document dumped into Excel without regard to relevance...
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •