Assuming Sheet1 colors in column A, Sheet2 has a color chosen in A2 and a value in B2 you want to "transfer" to Sheet1, then this will work:
Option Explicit
Sub TransferValue()
Dim Rw As Long
With Sheets("Sheet1")
Rw = .Range("A:A").Find([A2].Value, LookIn:=xlValues, LookAt:=xlWhole).Row
.Range("B" & Rw).Value = [B2].Value 'always puts value in Sheet1 column B
End With
End Sub
If you want to transfer the value to the next empty cell in the same row so you never replace any values already transfered, but keep adding more and more, change this line of code:
.Cells(Rw, .Columns.Count).End(xlToLeft).Offset(, 1).Value = [B2].Value 'always add in empty cell
The button that activates this macro needs to reside on Sheet2.
Bookmarks