Match the Excel File content with word document

K

Katy

Dear Sir,

I am a research student in HK. Actually i would like to find whether the
document in words format include the company name in excel.

I found difficuities in matching the content in Excel file (including 3,000
company name) with the words documents (around 3,000).

Do you have any suggestion for above case? Thank you so much in advance.
 
J

Joel

there are lots of things you can do quickly using macro in excel. You can
import the file names of the word documents with this code

Sub Getfilenames()
Folder = "c:\temp\"
FName = Dir(Folder & "*.doc")
RowCount = 1
Do While FName <> ""
Range("A" & RowCount) = FName
RowCount
FName = Dir()
Loop
end Sub

You can open Word dcouments from Excel macros and get anything from insdie
the word document using an Excel Macro.
 
K

Katy

Dear Sir,

I am apprecaited for your prompt action. Due to my limitation , my
understanding of your replied is insufficient, i try to write the macro as
below:

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 10/13/2008 by AF
'
' Sub Getfilenames(management information system testing 1)
' Folder = "C:\Documents and Settings\user\Desktop\Factiva Result"
' FName = Dir(Folder & "*.doc")
' RowCount = 1
' Do While FName <> ""
' Range("A" & RowCount) = FName
' RowCount
' RowCount = RowCount + 1
' FName = Dir()
' Loop
' end Sub

However, i can run the macro. I think that i done something wrong. Could you
please help to advise?

Regards
Katy
 
D

Dave Peterson

One of the things that is wrong is that you didn't include the trailing
backslash in your folder name:

Folder = "C:\Documents and Settings\user\Desktop\Factiva Result"
should be:
Folder = "C:\Documents and Settings\user\Desktop\Factiva Result\"

And the line that only has rowcount on it should be deleted.

Sub Getfilenames(management information system testing 1)
Folder = "C:\Documents and Settings\user\Desktop\Factiva Result\"
FName = Dir(Folder & "*.doc")
RowCount = 1
Do While FName <> ""
Range("A" & RowCount) = FName

RowCount = RowCount + 1
FName = Dir()
Loop
end Sub

If that doesn't help, it's time to share what the problems are in more detail.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top