Hi
I have a problem, http://goo.gl/i82eA this is sample data that I have with the required output. Currently I have a user defined function that is manually using many if statements to do the job but I want to be able to do something like a vlookup if it finds a certain color in a colum and return the colormap coresponding to it.
Or use like a filter function like filter all cells that contain Blue and give the destination cell with blue, and then run next filter with next value in an table of colors.
Color ColorMap Text Required Output
blue blue Deep Blue Shoe Blue (if Text contains blue return blue)
red red Deep red Shoe red (if Text contains red return red) etc
tan brown Tan Shoe brown
navy blue Navy Emp Shoe blue
jade green Jade Shoe green
plum red Plum Red Shoe multicoloured (if Text contains more than 1 color return multicolored)
So input should be like 2 columns for the data to be looked up 1 column for searching and the 1 column is the destination column if its a function
function_name(lookup_text,lookup_table,destination)
Thanks in advance
ps: here is the code Im using now
Function Colormap(strVal As String) As String
If (InStr(strVal, "red") > 0) Then
Colormap = "Red"
End If
If (InStr(strVal, "Beige") > 0) Then
Colormap = "Beige"
End If
etc..
End Function
Bookmarks