Re: June/July 2008 Challenge of the Month
Modified code for checking all color names and assigning them is as follows:
Sub Assign3()
For i = 2 To Range("D2", Range("D2").End(xlDown)).Count + 1
Colorname = LCase$(Cells(i, "D").Value)
Name = Cells(i, "E").Value
For j = 2 To Range("A2", Range("A2").End(xlDown)).Count + 1
colorexist = InStr(1, LCase$(Cells(j, "A").Value), Colorname)
If colorexist <> 0 Then
If Cells(j, "B").Value = "" Then
Cells(j, "B").Value = Name & ": " & Cells(j, "A").Value
Else
Cells(j, "B").Value = Cells(j, "B").Value + Chr(10) + Name & ": " & Cells(j, "A").Value
End If
End If
Next
Next
End Sub