Macro for batch search/replace but also add columns (advanced?)

richiwatts

Board Regular
Joined
Aug 27, 2002
Messages
131
Hi,
Can someone help me with a batch search replace script?

I get a fixed a list of names in column A every month. I have a fixed list of 100 people but each month, the amount of people reporting is different.

Chris Dean
John farmer
Tony Smith

I need to batch search and replace these names so that I end up with

JPY<NC>80<NC>Chris Dean
USD<NC>5<NC>John farmer
EUR<NC>6<NC>Tony Smith

This is the person's hourly rate. NC just means nnew column.

So after the batch search and repalce I end up with Name in column C, amount in column B and currency in Column A.

Thanks for your help.

Rich
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
do you have a table somewhere so you can look up Chris Dean and obtain JPY and 80 ?

if so put JPY in col B 80 in col C make col D = col A then use a macro to copy columns A to D, paste special values and delete column A
 
Upvote 0
do you have a table somewhere so you can look up Chris Dean and obtain JPY and 80 ?

if so put JPY in col B 80 in col C make col D = col A then use a macro to copy columns A to D, paste special values and delete column A

yes, I have a table in another sheet but I am not sure I understand the above. Can you hekp with an example?
 
Upvote 0
glad to help - and to put a new arrow in your quiver - just remember to put first column into ascending order - if this is not possible then offset match can be used
 
Upvote 0
Chris Dean£18Chris Deancol J
namecurrencyamountrow 5
formulaJohn farmer£3
=OFFSET($J$5,MATCH(A1,$J$6:J448,0),1)&OFFSET($J$5,MATCH(A1,$J$6:J448,0),2)&A1Tony Smith$22
Chris Dean£18

<colgroup><col><col><col span="7"><col><col span="4"></colgroup><tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,478
Members
448,967
Latest member
visheshkotha

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