[exel, macro] compate and update columns

m0n085

New Member
Joined
Sep 12, 2014
Messages
1
Hi!

I need help with macro. I have two sheets WORK and UPDATE

WORK
http://i.imgur.com/cEnhA9i.png
UPDATE
http://i.imgur.com/HiSg2kq.png

I need macro to compare two sheets by NAME (B column) and when found same name, copy price from UPDATE (G column) to sheet WORK to P column, else add on end of WORK sheet new entry and copy rest of row into proper order ( column C from UPDATE copy to E column in WORK... etc). I use office 2013, end work on PC.

I found on board this macro, but they don't work for me
Code:
Option Explicit Sub UpdateW2() ' hiker95, 06/16/2011 ' http://www.mrexcel.com/forum/showthread.php?t=557784 Dim w1 As Worksheet, w2 As Worksheet Dim c As Range, FR As Long Application.ScreenUpdating = False Set w1 = Worksheets("Sheet1") Set w2 = Worksheets("Sheet2") For Each c In w1.Range("A2", w1.Range("A" & Rows.Count).End(xlUp))   FR = 0   On Error Resume Next   FR = Application.Match(c, w2.Columns(1), 0)   On Error GoTo 0   If FR <> 0 Then w2.Range("B" & FR).Value = c.Offset(, 1) Next c Application.ScreenUpdating = True End Sub</pre>


Can you help me?
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,222,121
Messages
6,164,079
Members
451,870
Latest member
Nikhil excel

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