+ Reply to Thread
Results 1 to 4 of 4

Generate list from matrix

Hybrid View

  1. #1
    Registered User
    Join Date
    04-24-2013
    Location
    Bristol
    MS-Off Ver
    Excel 2010
    Posts
    32

    Generate list from matrix

    Hi there

    Please see the attached.

    ListGenerate.xlsx

    Appreciate I am asking a lot, but dont know where to start with this one...

    On Sheet2 I would like to be able to select the name of the person then hit the generate list command button, the list is pulled from Sheet1.

    I have populated Sheet2 as I would expect to see it.

    Thanks
    Biffer

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Generate list from matrix

    Try this in sheet2 Module:-
    NB:- The list updates in sheet2 when the Validation cell "D2" is changed.
    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim Rng As Range
    Dim Dn As Range
    Dim Ray()
    Dim c As Long
    If Target.Address(0, 0) = "D2" Then
        Application.EnableEvents = False
    
    Select Case Range("D2")
    Case "Dave": Set Rng = Sheets("Sheet1").Range("B:B,C:C,D:D").SpecialCells(xlCellTypeConstants)
    Case "Jeff": Set Rng = Sheets("Sheet1").Range("E:E,F:F,G:G").SpecialCells(xlCellTypeConstants)
    Case "Steve": Set Rng = Sheets("Sheet1").Range("H:H,I:I,J:J").SpecialCells(xlCellTypeConstants)
    End Select
    
    For Each Dn In Rng
        If Dn = "X" Then
            c = c + 1
            ReDim Preserve Ray(1 To 2, 1 To c)
            Ray(1, c) = Sheets("Sheet1").Cells(Dn.Row, 1)
            Ray(2, c) = Right(Sheets("Sheet1").Cells(2, Dn.Column), 1)
        End If
    Next Dn
    
    With Sheets("Sheet2")
        .Range("A:B").ClearContents
        .Range("A2:B2").Value = Array("Tool Used", "Option")
        If c > 0 Then .Range("A3").Resize(c, 2) = Application.Transpose(Ray)
    End With
    
        Application.EnableEvents = True
    End If
    End Sub
    Regards Mick

  3. #3
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Generate list from matrix

    hi Biffer, option, select name and press button on Sheet2
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    04-24-2013
    Location
    Bristol
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: Generate list from matrix

    Hi guys...thanks for your help. I have gone with watersev's option as the Name range is dynamic (sorry should have explained that)

    Regards
    Biffer

+ 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: 6
    Last Post: 06-19-2015, 04:49 AM
  2. Auto-Generate List from reference cells based on data validation list selection
    By BoundCustomDesign in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-13-2014, 11:06 AM
  3. How to generate from larger list a short list that meets multiple criteria
    By ablacksheep in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-28-2014, 09:37 AM
  4. Convert Matrix to List (excluding blank cells from list)
    By cameron.rumball in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-02-2013, 12:35 AM
  5. [SOLVED] Generate specific matrix
    By jiyed, m in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-10-2005, 05:20 PM

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