+ Reply to Thread
Results 1 to 15 of 15

Search Any Keyword in Drop Down List

Hybrid View

  1. #1
    Registered User
    Join Date
    06-09-2018
    Location
    Sacramento, CA
    MS-Off Ver
    Excel 2016
    Posts
    5

    Search Any Keyword in Drop Down List

    Hello - I'm new to the forum. There is such a plethora of information here and I'm enjoying learning new things already. I joined to ask a specific question, however, if it has been previously answered please feel free to redirect my attention.

    I created a time tracking worksheet for my company. In this time tracking worksheet there is a list of project names which I've created and made searchable through the use of data validation and a query. Currently, you begin in a cell by typing the Project number, however, my boss would like to be able to type any keyword related to the project and have the selection auto-populate. For example, the list might contain names such as:

    IT1 Jones (Hess)
    IT2 Smith (Walter)
    IT3 Rutan (Rowe)
    IT4 Fields (Dube)

    Currently, you can search by typing "ITP1", "ITP2", "ITP3" etc. etc. However, my boss would like to be able to type "Smith", or "Rowe" and have the selection auto-select and/or auto-populate. I'd also like to have a visible scroll bar.

    Again, not sure if this is the right forum but any assistance would be greatly appreciate. I consider myself an intermediate level user of Excel and am pleased with the success of this project thus far. It's just these last few nit picky things that I would like to adjust that are driving me bonkers.

    Please let me know if any questions.

    Thank you,

    Jessica

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Search Any Keyword in Drop Down List

    Hi Jessica, welcome to the forum.
    There are several ways you could do this and even without macro coding VBA.
    To make it easier for any of us to help you I would advice you to upload a sample file with the table lay-out you're using and some dummy non-sensitive data.
    Do you have any experience with macros, VBA code?
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    06-09-2018
    Location
    Sacramento, CA
    MS-Off Ver
    Excel 2016
    Posts
    5

    Re: Search Any Keyword in Drop Down List

    Hi Keebellah,

    Thanks for your help on this. I have minimal experience with macros and VBA code but am learning and loving it more every day.

    I'd like to include a test version, however, when I try to upload I'm told the file is too large. I tried reducing the size by converting to binary, no such luck. Is there any other way to get the file to you?

    Thanks again.

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Search Any Keyword in Drop Down List

    Hi Jessica,
    Have you tried zipping the file?
    Read my PM

  5. #5
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Search Any Keyword in Drop Down List

    Hi Jessica,
    Here's your file, resized so it will fit. I have attached it since there is no sensitive information in the data.
    You should try and avoid over 1 million rows with formulas.
    I reduced it to 10000 rows so it 'fits' and opens without any issues.
    I'll see if I can can help
    Always check why a file is 'suddenly' over sized, press Shift+Ctrl+End in each worksheet and it will take you to the last filled row and columns
    Attached Files Attached Files

  6. #6
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Search Any Keyword in Drop Down List

    First of all: What are you trying to do here?

    I reduced it to a variable LastRow but what does it invoke, doesn't work here but that clear because I do not have the refresh connection which seems to be the the same file but I have to figure it out.
    And where do you want the search to show up, at which moment?
    Could you please explain this? It overwrites the active cell in A or whatever you have as active cell with the now() value


    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    Dim lastRow As Long
    lastRow = Range("A" & Rows.Count).End(xlUp).Row + 1
    
    If Not Intersect(Target, Union(Range("D2:D" & lastRow), Range("E2:E" & lastRow), Range("A2:A" & lastRow))) Is Nothing Then
        Cancel = True
        Target.Formula = Now()
    End If
    Dim str As String
    Dim cboTemp As OLEObject
    Dim ws As Worksheet
    Set ws = ActiveSheet
    
    Set cboTemp = ws.OLEObjects("TempCombo")
      On Error Resume Next
      With cboTemp
      'clear and hide the combo box
        .ListFillRange = ""
        .LinkedCell = ""
        .Visible = False
      End With
    On Error GoTo errHandler
      If Target.Validation.Type = 3 Then
        'if the cell contains
          'a data validation list
        Cancel = True
        Application.EnableEvents = False
        'get the data validation formula
        str = Target.Validation.Formula1
        str = Right(str, Len(str) - 1)
        With cboTemp
          'show the combobox with the list
          .Visible = True
          .Left = Target.Left
          .Top = Target.Top
          .Width = Target.Width + 5
          .Height = Target.Height + 5
          .ListFillRange = str
          .LinkedCell = Target.Address
        End With
        cboTemp.Activate
        'open the drop down list automatically
        Me.TempCombo.DropDown
      End If
      
    errHandler:
      Application.EnableEvents = True
      Exit Sub
    
    End Sub

  7. #7
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Search Any Keyword in Drop Down List

    I am missing the file named 'FS Projects Drop Down List.xlsx'this where you pick the data and dropwonlist

  8. #8
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Search Any Keyword in Drop Down List

    Figured it out, the connection is to the worksheet in the same file. Since you probably copied it to mail the reference remains to the original file.
    In these cases you should open the file and select save as to keep the connections valid.

    Okay, the doubleclick is entirely wrong since you have three columns you check on but the first (in A is not related to D or E.
    There is no explanation what you want the user to do.
    Pick an item from the dropdown list?
    I think that a a richt click (or double click) to show a userform with the possible choices and a fill field to select while typing would be the best.
    Will work on that (based on my assumption of what you want) and hope I'm on the right track.

  9. #9
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Search Any Keyword in Drop Down List

    My idea.
    Column B row x must not be empty, so first select a code in column B from the dropdown list there
    Then select column C and right click in the user form you can either select an item in the listbox or start typing in the textbox above select the item in the listbox and press commit.
    The Item in the listbox selection MUSt be doen, I did not add any tests for that.
    The listbox will show the item(s) that contain the text typed in the textbox above
    Attached Files Attached Files

  10. #10
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Search Any Keyword in Drop Down List

    Some (minor) modifications explanation in textbox in the TimeSheet worksheet
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    06-09-2018
    Location
    Sacramento, CA
    MS-Off Ver
    Excel 2016
    Posts
    5

    Re: Search Any Keyword in Drop Down List

    Thank you for the feedback. I greatly appreciate the time and effort you've put into this.

    To answer your question: My colleagues and I perform project-based work. Currently, we have upwards of 100 projects going. When we receive a new project I add the project name to our drop-down list in the worksheet. Every we day as we are working on projects we log into this worksheet to track our time. I want to simplify the use of this worksheet by allowing for double-click entry of the date and time. For the drop-down list, I want to be able to type any part of the name of the project to select the correct entry. I want the search to show up in column C and the user should be able to either pick an item from the drop down list, or, start typing the name or number of the project and have the list auto-populate. I hope that information helps.

    Thank you again.



    "First of all: What are you trying to do here?

    I reduced it to a variable LastRow but what does it invoke, doesn't work here but that clear because I do not have the refresh connection which seems to be the the same file but I have to figure it out.
    And where do you want the search to show up, at which moment?
    Could you please explain this? It overwrites the active cell in A or whatever you have as active cell with the now() value"

    "Okay, the doubleclick is entirely wrong since you have three columns you check on but the first (in A is not related to D or E.
    There is no explanation what you want the user to do.
    Pick an item from the dropdown list?
    I think that a a richt click (or double click) to show a userform with the possible choices and a fill field to select while typing would be the best.
    Will work on that (based on my assumption of what you want) and hope I'm on the right track."

  12. #12
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Search Any Keyword in Drop Down List

    Clear, but, can you work with the file as it is now?
    Type and select as you go is not possible in the dropdown list (as far as I have seen 'til now) but maybe the properties can be changed
    Will see if I find something, but I doubt it.
    The way it works now with selecting a value in column B and the opening the form for Column C seemed like a nice trick

  13. #13
    Registered User
    Join Date
    06-09-2018
    Location
    Sacramento, CA
    MS-Off Ver
    Excel 2016
    Posts
    5

    Talking Re: Search Any Keyword in Drop Down List

    I agree, selecting a value in column B and the opening the form for Column C is a great trick. I can work with the file as it is now. I'll look at the properties also and see if anything can be adjusted.

  14. #14
    Registered User
    Join Date
    06-09-2018
    Location
    Sacramento, CA
    MS-Off Ver
    Excel 2016
    Posts
    5

    Thumbs up It's Alive!!! Re: Search Any Keyword in Drop Down List

    This works so well! I'm eternally grateful for your help.

  15. #15
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Search Any Keyword in Drop Down List

    Glad to have been able to do so

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Search cells C1:C3000 for keyword and if exists place a keyword in A1:A3000
    By GregQuick in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-24-2015, 07:38 PM
  2. Replies: 6
    Last Post: 03-18-2014, 11:16 AM
  3. Using Certain Drop Down List Depending on keyword
    By crossmancal3 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-03-2013, 06:22 PM
  4. Search list using keyword and select item
    By BrianBam in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-11-2013, 09:47 PM
  5. Column keyword search using list of keywords
    By tshrader in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-28-2011, 03:46 PM
  6. Prompting a keyword to search, then list all the lines where it is found
    By pylauzier in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-28-2011, 04:27 PM
  7. Replies: 1
    Last Post: 12-27-2010, 08:53 AM

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