Hi All,
I need some changes in below code. This code compare column A in 2 sheets and copy values which are present in Column B and C of 2nd sheet. What I need is that macro compares columns A, B and C in both sheet and if all values are same then it copies value in column D and paste in sheet 1. Any ideas…….Thanks a lot for your time and answers.
I need some changes in below code. This code compare column A in 2 sheets and copy values which are present in Column B and C of 2nd sheet. What I need is that macro compares columns A, B and C in both sheet and if all values are same then it copies value in column D and paste in sheet 1. Any ideas…….Thanks a lot for your time and answers.
PHP:
' ws1 and ws2 are worksheet objects. Set them to point to the sheets.
'ws2 is updated sheet
'ws1 is the sheet where values are updated by the code.
For Each cell In ws2.Range("A1:A" & ws2.Range("A1048576").End(xlUp))
If cell = "" Then GoTo nextVal
Set rng1 = ws1.Range("A1").EntireColumn.Find(cell)
If rng1 Is Nothing Then GoTo nextVal
ws1.Cells(rng1.Row, rng1.Column + 1) = ws2.Cells(cell.Row, cell.Column + 1)
ws1.Cells(rng1.Row, rng1.Column + 2) = ws2.Cells(cell.Row, cell.Column + 2)
nextVal:
Next