+ Reply to Thread
Results 1 to 9 of 9

VBA search box

  1. #1
    Registered User
    Join Date
    03-20-2017
    Location
    Oslo
    MS-Off Ver
    2010
    Posts
    35

    VBA search box

    Hi,

    I have two rows with 10.000 lines each, i wonder if there is possible to make an easy search box using VBA, searching values in row A and then get the Value of row B in the search box?
    vba.PNG

    Thank you in advance

    Henrik

  2. #2
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: VBA search box

    Hi henrik- I can't tell if those are Filtering drop-downs or ActiveX controls, but filtering your data seems like what you're after. To filter, select any cell in the header row, then press CTRL+SHIFT+L. Now filter for A values of interest to see corresponding B values. If you already understand filtering, then it sounds like you're after a multi-column List Box.
    Last edited by leelnich; 05-15-2017 at 05:27 AM.

  3. #3
    Registered User
    Join Date
    03-20-2017
    Location
    Oslo
    MS-Off Ver
    2010
    Posts
    35

    Re: VBA search box

    Hi,

    Thank you for the response, it is a lot of similar numbers so normal filtering is not working so well. What i was wondering is making a Active X controlled search button, but not sure how the VBA code would be.

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: VBA search box

    Hi hendrikvv

    This should give you an idea:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  5. #5
    Registered User
    Join Date
    03-20-2017
    Location
    Oslo
    MS-Off Ver
    2010
    Posts
    35

    Re: VBA search box

    Hi sintek,

    That is awesome, exactly what i wanted The numbers go down to row 10555, how do i extend the VBA code to search all of them?

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: VBA search box

    The code does that....

  7. #7
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: VBA search box

    Henrik- If you look at his code (5th line "lRow = ..."), you'll see he finds the last row in column A, so you should be able to see all the values.

  8. #8
    Registered User
    Join Date
    03-20-2017
    Location
    Oslo
    MS-Off Ver
    2010
    Posts
    35

    Re: VBA search box

    You are right, had my numbers in the wrong format. It works perfectly now, thank you so much sintek

  9. #9
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: VBA search box

    Pleasure...Please mark thread as solved and please add to my reputation....
    click on the star to left of post [Add Reputation]

    Edited:

    Thanks for rep points
    Last edited by sintek; 05-15-2017 at 09:13 AM.

+ 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. [SOLVED] Search multiple worksheets for search term and paste results in a summary sheet
    By Andy15 in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 04-03-2017, 01:49 PM
  2. [SOLVED] Code to search Excel and return results even if part of search text is present
    By Taoyuan00 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-30-2016, 09:20 AM
  3. Replies: 4
    Last Post: 12-02-2014, 05:17 PM
  4. Replies: 4
    Last Post: 11-08-2014, 04:57 AM
  5. Replies: 4
    Last Post: 05-20-2014, 10:03 AM
  6. VBA Code - Search text & search number & search qty and result - Urgent Please
    By naresh73 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-15-2014, 10:51 AM
  7. Replies: 1
    Last Post: 10-18-2012, 05:52 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