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
Can you help me?
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?