![]() |
Match the Excel File content with word document
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. |
Match the Excel File content with word document
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. "Katy" wrote: 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. |
Match the Excel File content with word document
And I bet you meant
RowCount = RowCount + 1 inside that do/loop. Joel wrote: 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. "Katy" wrote: 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. -- Dave Peterson |
Match the Excel File content with word document
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 "Dave Peterson" wrote: And I bet you meant RowCount = RowCount + 1 inside that do/loop. Joel wrote: 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. "Katy" wrote: 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. -- Dave Peterson |
Match the Excel File content with word document
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. Katy wrote: 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 "Dave Peterson" wrote: And I bet you meant RowCount = RowCount + 1 inside that do/loop. Joel wrote: 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. "Katy" wrote: 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. -- Dave Peterson -- Dave Peterson |
All times are GMT +1. The time now is 12:45 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com