PDA

View Full Version : VBA Find from EXCEL replace to WORDS HELP !!!!



wwchoi
08-17-2008, 03:43 AM
Hi all, i have done some research over 1 month but still cant solve my problem hope anyone help me !! the details as below:

i have a table in excel, example as below:
Column 1 Column 2
H05-001 50HKS305
H05-002 50HKS306
H05-003 60HKS307

and i have an essay/manual in WORDS
i wish to find the word from excel(the Table)and replace to WORDS (essay/manual).
meaning find the COLUMN 1 and Replace the COLUMN 2 to the Essay/manual in microsoft WORDS.

is that possible?

within excel i have done it but not both excel and words.
anyone help would be highly appreciated.

thanks !

WWCHOI

Aussiebear
08-17-2008, 04:13 AM
Hi wwchoi, Welcome to the forum. Can you clear up a couple of points here please?

1. I'm assuming that you want to send the data from the Excel table to MS Word (Essay/Manual). Is this correct?
or
2. Are you wanting to find a value within Column 1 of the Excel table and then send the appropriate value in Column 2 to MS Word?

wwchoi
08-18-2008, 07:23 AM
Hi wwchoi, Welcome to the forum. Can you clear up a couple of points here please?

1. I'm assuming that you want to send the data from the Excel table to MS Word (Essay/Manual). Is this correct?
or
2. Are you wanting to find a value within Column 1 of the Excel table and then send the appropriate value in Column 2 to MS Word?

Dear Aussiebear,

First of all thanks for your reply really appreciate it.

ok let me clarify, i have an essay which is in WORDS. in this essay it will appear H05-001, H05-002 and so and so. it appear in the essay repeatly. so i would like to run a program that it will find the word from excel 1st and replace in WORDS. for example, from excel i detect the 1st column which is H05-001 and then find the h05-001 from WORDS. once found the H05-001 from WORDS and replace with 50HKS305 (H05-001) which is 2nd column. meaning replacing the adjacent word that finding. is it possible ? after that find H05-002 and replace 50HKS306 and run it continously and stop it when the excel program detected there is blank cell.


wish it clear for you.
thanks a lot for helping me!!

kind regards
WWCHOI

Aussiebear
08-20-2008, 05:08 AM
As I understand it, you have a 2 column table in an Excel workbook, and a document in MS Word. You are looking for the ability to search in the documentfor the first value contained in the Column 1 of the Excel table, and when found, replace it with the corresponding value in Column 2 of the Excel table.

Can you tell me the names of the Excel Workbook and the Word file, the location of the Excel table (sheet and range)?

While this is beyond my personal skill level, I'm confident that since we have cleared up the confusion relating to your request, then someone will be along to assist as soon as you are able to provide the requested information.

wwchoi
08-20-2008, 06:22 AM
Hi thanks !!
The MS excel file name is "conversion table.xlsx" and the MS words is " Function Description.docx".
The EXCEL table sheet is just sheet 1 and the range will be from A1 to B500.

actually i have did some program, just don't how to link it with docx file. Meaning i able to scan from excel which is scan cells by cells, but don't search/scan from docx.
may i know the concept ?? i have try to copy and paste to excel but the format run out. it's take time to reformat all the things ( talking about over 100 pages). that's why i am thinking to write a simple program so that easy for future use. i hope anyone can help.

anyone able to help will be highly appreciated.

thanks !
WWCHOI