Sub AddorChangeCellValueBasedOnCellColor() ' Fill in cells based on defined cell colour Dim rg As Range Dim xRg As Range Set xRg = Selection.Cells Application.DisplayAlerts = False For Each rg In xRg With rg Select Case .Interior.Color Case Is = RGB(255, 0, 0) 'Red .Value = "Remove" 'Can simply replace with number Case Is = RGB(146, 208, 80) 'Light Green .Value = "Add" 'Can also replace the Add simply replace with number no quotation marks End Select End With Next Application.DisplayAlerts = False End Sub
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter