Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Feb 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Pulling rows from one tab into another based on a value

    I have a list of 1000+ questions in a tab labeld Question Bank with a structure similar to below:

    Capture.PNG

    What I am looking to do is have a Tab for the different Categories (Netowrk, Business, Daatabase, ect) that will populate with the questions that were indicated with "Yes" to Use from the Question Bank tab.

    Pivot Tables don't seem to meet the need as they want to calculate when I simply wnat to populate the tab based on the category and indication to use the question.

    Any direction or insight would be greatly appreciated.
    Last edited by Nameste2U; 2013-02-20 at 16:22.

  2. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,434
    Thanks
    371
    Thanked 1,457 Times in 1,326 Posts
    N2U,

    Welcome to the Lounge as a new Poster!

    What you want, I think, is an Advanced filter which can be found on the Data Tab.
    This type of filter works best if you setup named ranges for your Database {data}.
    The Selection Criteria {what you want to copy}.
    And lastly the Extract {where the answer goes}.
    It also works best if you have the Criteria and Extract on the same tab since Excel always wants to copy the data to the Active worksheet. See the attached worksheet and the graphic below.
    AdvFilter.JPG
    HTH
    Attached Files Attached Files
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  3. #3
    New Lounger
    Join Date
    Feb 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That works thank you.

    I will create a macro for it and assign it to a button.

    Again many thanks.

  4. #4
    Gold Lounger Maudibe's Avatar
    Join Date
    Aug 2010
    Location
    Pa, USA
    Posts
    2,631
    Thanks
    115
    Thanked 645 Times in 589 Posts

    Just another way of doing the same thing except with VBA

    Here is a totally different approach that sends the question to the appropriate sheet if Use=Yes. VBA will update the sheets everytime they are activated.

    HTH,
    Maud

    Code:
    Private Sub Worksheet_Activate()
    With Worksheets("Question Bank")
    Cells.ClearContents
    Cells(1, 1).Value = "Question Type"
    Cells(1, 2).Value = "Question"
    Cells(1, 3).Value = "Question Information"
    
    lastRow = .Cells(Rows.Count, 1).End(xlUp).Row
    Row = 2
    For I = 2 To lastRow
    If .Cells(I, 2).Value = "Network" And .Cells(I, 1).Value = "Yes" Then
        Cells(Row, 1) = .Cells(I, 3).Value
        Cells(Row, 2) = .Cells(I, 4).Value
        Cells(Row, 3) = .Cells(I, 5).Value
        Row = Row + 1
    End If
    Next I
    End With
    End Sub
    Attached Files Attached Files

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •