Find and Match

miztiik

New Member
Joined
Jul 4, 2007
Messages
20
Code:
     A--------------b----------------c
1  abc                           klm-sometext
2  def                           nop-sometext
3  ghi                           def-sometext
4  klm
5  nop                           ghi-sometext
6                                abc-sometext


i want a macro , so that when it is run,
it matches the value in column A with value in Column C
and update the same in Column B

For example the macro should find

A1 Value = abc with C6 Value= abc-sometext
and update
B1 value as = abc-sometext

So after running the macro
the excel sheet should look like this
Code:
     A-----------------b------------------------c
1  abc           abc-sometext              klm-sometext
2  def           def-sometext              nop-sometext
3  ghi           ghi-sometext              def-sometext
4  klm           klm-sometext
5  nop           nop-sometext              ghi-sometext
6                                          abc-sometext
 

smartchap

Board Regular
Joined
Aug 26, 2006
Messages
63
Please change the following line
If Sheets(1).Cells(j, 1).Value = Left$(Sheets(1).Cells(k, 3).Value, Len(Sheets(1).Cells(j, 1).Value)) Then

as

If UCase$(Sheets(1).Cells(j, 1).Value) = UCase$(Left$(Sheets(1).Cells(k, 3).Value, Len(Sheets(1).Cells(j, 1).Value))) Then

to make it case insensitive and it will work perfectly.


Always believe in GOD.
smartchaps97@rediffmail.com
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

miztiik

New Member
Joined
Jul 4, 2007
Messages
20
Sometimes when contents are copies from other documents, they have new line characters in the end. and cause the script/macro to fail , any suggestions on that?
 

Forum statistics

Threads
1,186,005
Messages
5,955,266
Members
438,188
Latest member
DLJ

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
Top