+ Reply to Thread
Results 1 to 11 of 11

Create a dynamic search list from user typed values

Hybrid View

  1. #1
    Registered User
    Join Date
    11-18-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    3

    Create a dynamic search list from user typed values

    Hi there,
    I have pretty much exhausted all potential ways of doing this.
    Basically, what I am after is for a user to type a value into the SEARCH field. Using a combination of vlookup, index or match - a list of values containing the search parameter from the Inv!B2:B5949 would be displayed in the PRODUCT NAME field.

    I have tried fiddling around with a dynamic list from another forum - but always ends up with N/A values.

    At the moment - the user has to type the INVCode from the Inv Sheet into the Recipe sheet for it to pull the values across.

    Any help or pointing in the right direction, would be greatly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Create a dynamic search list from user typed values

    Hi

    So if a user typed LOWENBRAU into Menu Item Cost!C8, the you would get a list of all 17 items that have that word in column B of Inv available for selection in D8? By Data Validation or something similar? Is that correct?

    rylo

  3. #3
    Registered User
    Join Date
    11-18-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Create a dynamic search list from user typed values

    Hi Rylo,
    Totally correct. I have scoured every source imaginable trying to work out how to do it.

  4. #4
    Registered User
    Join Date
    11-16-2012
    Location
    Crownpoint, New Mexico
    MS-Off Ver
    All.
    Posts
    59

    Re: Create a dynamic search list from user typed values

    I would solve this by inserting hidden rows with the inventory...

    for blank cells betwixt I would use a tick ' to allow the autocomplete...

    I'm going to try to work something up either tonight or tomorrow.

    [EDIT]
    Getting nowhere fast. If anybody else has ideals, might want to help out!
    Last edited by cnodnarb; 11-19-2012 at 01:01 AM.
    Please click * to add to my reputation!

  5. #5
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Create a dynamic search list from user typed values

    Hi

    Try this

    Right click on the Menu Item Cost tab, select View Code and paste in
    Private Sub Worksheet_Change(ByVal Target As Range)
      If Not Intersect(Target, Range("C8:C20")) Is Nothing And Len(Target.Value) > 0 Then  '.Address = "$C$8" Then
        Set Rng = Sheets("Inv").Range("B2:B6000")
        holder = ""
        For Each ce In Rng
          If InStr(1, ce, Target.Value) > 0 Then
            holder = holder & ce.Value & ","
          End If
        Next ce
        If Len(holder) > 0 Then
          With Target.Offset(0, 1).Validation
            .Delete
            .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
            xlBetween, Formula1:=holder
            .IgnoreBlank = True
            .InCellDropdown = True
            .InputTitle = ""
            .ErrorTitle = ""
            .InputMessage = ""
            .ErrorMessage = ""
            .ShowInput = True
            .ShowError = True
          End With
        
        End If
      ElseIf Len(Target.Value) = 0 Then
        With Target.Offset(0, 1).Validation
            .Delete
        End With
      
      End If
    End Sub
    Now type BIER in C8, and move to D8. You should find a drop down list of relevant items.

    HTH

    rylo

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Create a dynamic search list from user typed values

    I think I may have a solution that will get you headed in the right direction. I created a helper column on sheet2 and used this...
    =IF(ISNUMBER(SEARCH('Menu Item Cost'!$C$8,Inv!$B2,1)),MAX($J$1:J1)+1,"")
    this searches for the data enetered in sheet1 C8, and numbers the returns
    for the next part, I wasnt sure of the distinction btw primary and secondary ingredients, so I put this in secondary, copied down...
    =IFERROR(INDEX(Inv!$A$2:$J$6000,MATCH(ROW(A1),Inv!$J$2:$J$6000,0),2),"")
    for the rest of the columns, you can just change the column number (,2) accordingly

    see attached

    (note: i removed the "table: function on sheet 2, you can make it a table again if you want. I find it easier to create formulas from "non-table" tables)
    Attached Files Attached Files
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  7. #7
    Registered User
    Join Date
    11-16-2012
    Location
    Crownpoint, New Mexico
    MS-Off Ver
    All.
    Posts
    59

    Re: Create a dynamic search list from user typed values

    Well, this is as best I could do.

    Apparently excel stops trying to autocomplete after the first 50 items or so, you can consider this one too though.

    Hmm...file is too big...am I allowed to link like this? (better to ask forgiveness than permission!)


    https://dl.dropbox.com/u/28521507/ex...odnarb%29.xlsm

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Create a dynamic search list from user typed values

    @ cnod, preferably not, because not every1 can access sites like dropbox (i cant from work), you could maybe try to zip the file and then send it?

  9. #9
    Registered User
    Join Date
    11-16-2012
    Location
    Crownpoint, New Mexico
    MS-Off Ver
    All.
    Posts
    59

    Re: Create a dynamic search list from user typed values

    @ fdibbins
    Noted! Will try that next time around

  10. #10
    Registered User
    Join Date
    11-18-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Create a dynamic search list from user typed values

    Thanks guys for the quick responses.
    The solution from fdibbins works quite seamlessly.

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Create a dynamic search list from user typed values

    Happy to help. If this answered your question, please take a moment to mark the thread as "solved" - it helps keep things neat and tidy lol, and consider adding the reputation to those that helped (see points 2 & 3 below)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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