+ Reply to Thread
Results 1 to 7 of 7

Searching Column and returning specific rows to UserForm

  1. #1
    Registered User
    Join Date
    06-26-2013
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2010
    Posts
    4

    Searching Column and returning specific rows to UserForm

    I have a multisheet database that I have programmed to give me the average of all products that fit ranges. It has to meet a specific criteria and when it does it throws up a "Y" pertaining to that project. I want to be able to see all the projects its averaging in a userform with all their corresponding data. So how do I search the column for "Y" and return the entire row to a UserForm for user viewing?

    Thank you!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Searching Column and returning specific rows to UserForm

    Hi,

    Are you sure you really need to put all these rows of data in a userform box? It would be more usual (and much much simpler) to filter the relevant rows in the database itself. Either filtering the data in place or extracting the filtered rows to a new range.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    06-26-2013
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Searching Column and returning specific rows to UserForm

    I'm trying to make it more user accessible where they don't have to flip through all the different sheets. Cause I have a database for 3 seperate project types. I have a main page and I made a button to show all projects and I think, (correct me if I'm wrong) other than filtering on the sheet, a userform would be the easiest way for the user to view all the corresponding projects...

  4. #4
    Registered User
    Join Date
    06-26-2013
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Searching Column and returning specific rows to UserForm

    I guess I could just extract the rows to a new range next to the averages on the main page...

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Searching Column and returning specific rows to UserForm

    Quote Originally Posted by battdan1 View Post
    I'm trying to make it more user accessible where they don't have to flip through all the different sheets. Cause I have a database for 3 seperate project types. I have a main page and I made a button to show all projects and I think, (correct me if I'm wrong) other than filtering on the sheet, a userform would be the easiest way for the user to view all the corresponding projects...
    I beg to differ. You'll see more of the records if you choose to filter the selections to a blank sheet rather than try and display them in a Userform box. Freeze the column headers so that they're not lost when someone scrolls down.

  6. #6
    Registered User
    Join Date
    06-26-2013
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Searching Column and returning specific rows to UserForm

    Okay, that works. What's the code to search in a different sheet for "Y" and return the entire corresponding row to a different sheet?

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Searching Column and returning specific rows to UserForm

    Hi

    First name your database, say 'data'

    Then in the sheet to which you want to copy the filtered records add a row of column labels and name this range say 'data_out'
    Create a two cell criteria range with the column label of the 'Y' column in one cell and immediately underneath it enter the value 'Y'. Name this range say 'crit'.

    Now the macro code to extract the records is simply

    Please Login or Register  to view this content.

+ 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