+ Reply to Thread
Results 1 to 4 of 4

Textbook value search & populating sheet with selected rows

  1. #1
    Registered User
    Join Date
    06-29-2015
    Location
    Buenos Aires, Argentina
    MS-Off Ver
    Microsoft Office 2013
    Posts
    4

    Textbook value search & populating sheet with selected rows

    hello guys, I am in a bind here at work. I'm not very good at using VBA macros and have been assigned a project that deals with searching through various spreadsheets using userform that has textboxes and checkboxes. What I am trying to do is type a value in textbox1, for example, and it searches the sheet for that value in column 1 and only populates the sheet with rows that have the value I typed in the textbox1. If that value doesn't exist or is wrong, i want it to say no match found. Same goes for the next textbook, which will actually be looking through a different column within the spreadsheet but once the textbook value matches the ones on the spreadsheet, i want it to populate it with those rows that have that value. I have the command buttons down (search, cancel, etc), the part i am stumped on is the textbox. The code I have is as follows below for the first textbox, but it does not work fully. Also, how would I continue the code with the second texbox search function without it interfering with the first?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Textbook value search & populating sheet with selected rows

    Sounds to me like you would be better off using AutoFilter. Submit your workbook for further review.

  3. #3
    Registered User
    Join Date
    06-29-2015
    Location
    Buenos Aires, Argentina
    MS-Off Ver
    Microsoft Office 2013
    Posts
    4

    Re: Textbook value search & populating sheet with selected rows

    userform.png

    The reason I didn't want to use autofilter is because I wanted it to be easy for someone else to just pull up that userform and select different types of searches without having to click around so much. This file isn't being made for my conveince though. Anyway, I played around with the code and took a slightly different approach. Please let me know what you think of it because it's still not fully working.

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Textbook value search & populating sheet with selected rows

    Autofilter can be performed within code so the steps will be the same you just will not have to do all the loops.

    I can't see the picture you uploaded.

    The code you supplied is inefficient and erranous. Submit a copy of your workbook.

+ 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. Replies: 1
    Last Post: 07-23-2015, 11:18 PM
  2. [SOLVED] Search and Find User on selected sheet
    By alimsab in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-06-2015, 09:03 AM
  3. VBA To copy selected data from one sheet to another depending on search box
    By leighmetcalfe in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2012, 05:52 AM
  4. Help Using 2 drop down to search Worksheet and populating another sheet
    By pjginoo in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 09-22-2011, 03:18 PM
  5. Search by rows and then go to selected row...in a frame?
    By Dave Linsalata in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2005, 11:06 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