Log in

View Full Version : [SLEEPER:] Import Specific txt from Word to Excel



gsltwahir
12-07-2017, 10:44 PM
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

macropod
12-08-2017, 02:04 PM
Is the extraction for just one Word document, or for multiple Word documents?

snb
12-19-2017, 07:57 AM
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

macropod
12-19-2017, 12:33 PM
Somehow I doubt the OP wants the whole document dumped into Excel without regard to relevance...