find replace function with a database

  • Thread starter Thread starter kauseway
  • Start date Start date
K

kauseway

I hope that was not too complicated. I guess a simplier way to put it
would be if you had data in column A and B. Then you used a macro to
search another worksheet or excell file with data in Say C and D
columns. The macro would start with C1 and search all the data in
column A (1 thru ##) to see if it matches C1. IF it found a match say
in A12 it would replace the data/text in b12 with that of d1. After
the first search the macro would repeat for as many values as were in
Column C. So then it would search all of column A for C2. If it found
a match in A230 then it would replace B230 with D2. hopefully that is a
little simpler and clear if someone has a suggestion?

Thanks.
 
assume the sheet with C and D columns is named Sheet2 and the sheet with A
and B columns is Sheet1

go to B1 of Sheet1. Put in a formula like

=Vlookup(A1,Sheet2!$C:$D,2,False)

then drag fill down the column.

If you data in Sheet 2 is sorted by column C, then you can try change the
False to True and if that will handle the slight variations, but I would be
cautious about that. Basically, I think you need to put a row for each
possible entry you would find in Sheet1.

If you then want hard coded values, Select Column B in sheet1 and do
Edit=>Copy then immediately Edit=>Paste Special and select values.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top