greenexcel12345,
Welcome to the forum. Attached is a modified version of your sample workbook. It contains a button named "Update Table" which is assigned to the following macro:
Sub UpdateTableMacro_for_greenexcel12345()
Const TableRange As String = "D5:I10"
Const UserInput As String = "C14:D19"
Dim rngTable As Range: Set rngTable = ActiveSheet.Range(TableRange)
Dim arrInput() As Variant: arrInput = ActiveSheet.Range(UserInput).Value
Dim i As Long
Dim TableCell As Range
For Each TableCell In rngTable
If TableCell.Interior.ColorIndex = 36 Then
For i = 1 To UBound(arrInput, 1)
If Cells(rngTable.Row - 1, TableCell.Column).Value = arrInput(i, 1) Then
TableCell.Value = arrInput(i, 2)
Exit For
End If
Next i
End If
Next TableCell
End Sub
Hope that helps,
~tigeravatar
Bookmarks