LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 399
Default Search Excel and copy result into word

Hi, Adrian. If you want to search the Word doc and do one sentence at a
time as you find one that needs replacing, I think you'd be better off
driving this from a Word macro. The way I would do it breaks down like
this:
-- Open Word doc and Excel workbook. These are the only Word and Excel
files open.
-- Make sure Excel workbook is open to the correct worksheet.
-- User selects a sentence in the Word doc to replace, and then runs the
macro.
The macro:
-- Sets objects to both files.
-- Set a bookmark at the selection.
-- Searches the Excel file for the selected text.
-- If found, replaces that with the desired text.

Then again, if you want to run the whole Word doc all at once, maybe an
Excel macro is better. I'd have it in the specific workbook that contains
you find/replace list. It would go like this:
-- Browse for Word doc and open.
-- Iterate through the Excel list, using those cell values to drive
Find/Replace in the Word doc.

The first way gives you control over replacing specific sentences; the
second way just runs through the entire doc. Which way sounds good to you?

Ed

wrote in message
oups.com...
Hi,

I'm a newbie to VBA programming and just trying to automate some tasks
for my Dad to save him some time. I have a word document and each of
these sentences are in a cell in excel (sheet1, column A, Starting at
cell 2 onwards). What I would like to do is create a program that will
take a sentence in word search for it in the above column and replace
it with the next in the next column over,

That is, if a sentence is found in A3 it would replace the sentence
with The text from B3.

Any help or advice on how to do this would be grateful.

Thaniks,
Adrian



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I search for a word within a excel document Jenny Excel Discussion (Misc queries) 2 January 14th 10 03:55 PM
Functions (search within search result) reply to this please Nick Excel Worksheet Functions 1 February 17th 09 03:57 AM
Functions (search within search result) Nick Excel Worksheet Functions 1 February 17th 09 03:51 AM
Copy from Word to Excel, and retain indent, plus word wrap Eric Excel Discussion (Misc queries) 1 March 9th 07 03:15 AM
search for a specific word and copy the word and the preceeding words until a comma DHANANJAY Excel Programming 12 December 31st 05 12:53 PM


All times are GMT +1. The time now is 10:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"