Find and Replace

Gugan V

New Member
Joined
Mar 26, 2013
Messages
8
Hi
I would like to create a simple excel macro which modifies text in an existing file, using values located in an excel sheet.
I want the macro to open the text file (which is located in a specific folder), to find the text located in excel's cell A1 and find standard keyword, and to replace it by excel's cell B1. Then, it should find the text located in excel's cell A2, and to replace it by excel's cell B2, and so on.
Example:
In my worksheet I have two columns “REFNAME (in column A1)” and “Designnote (in column B1)” with values . My requirement is, first finds the REFNAME and again finds next keyword and then replaced with B1 values.
<description><questionref id="c08c9e11-b53d-4203-b82c-66776a50aed3">
Text File Example
RefName="CMSTDTCIT" xmlns="http://phaseforward.com/CSML/2009-06-11"><Description /><CustomProperty><Name>Item Required</Name><Value>true</Value></CustomProperty><CustomProperty><Name>SDV Required</Name><Value>true</Value></CustomProperty><Title>CMSTDTCIT</Title><QuestionRef Id="c08c9e11-b53d-4203-b82c-66776a50aed3" />

in above lines "CMSTDTCIT" will be available in A1 cells and again system should fine the next standared keyword (keyword is =<Description />)
<description>
so i want to replace the text <Description /><description> with B1 cell value.

Can anyone please help me with this issue, I've been trying it out myself but cannot find a solution.</description></description></questionref></description>
 
Last edited:

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,214,935
Messages
6,122,337
Members
449,077
Latest member
Jocksteriom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top