Results 1 to 7 of 7

Complex Vlookup/ VBA function or Macro Needed For "if contains text then vlookup"

Threaded View

alfykunable Complex Vlookup/ VBA function... 12-13-2011, 02:35 AM
martindwilson Re: Complex Vlookup/ VBA... 12-13-2011, 03:42 AM
alfykunable Re: Complex Vlookup/ VBA... 12-13-2011, 03:54 AM
Ryan Murtagh Re: Complex Vlookup/ VBA... 12-13-2011, 08:54 AM
alfykunable Re: Complex Vlookup/ VBA... 12-14-2011, 07:17 AM
Ryan Murtagh Re: Complex Vlookup/ VBA... 01-04-2012, 01:23 AM
alfykunable Re: Complex Vlookup/ VBA... 01-09-2012, 03:48 AM
  1. #1
    Registered User
    Join Date
    12-13-2011
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    47

    Complex Vlookup/ VBA function or Macro Needed For "if contains text then vlookup"

    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
    Attached Files Attached Files
    Last edited by alfykunable; 12-13-2011 at 03:54 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1