Help: Table with multiple values to List

Xerno

New Member
Joined
Oct 26, 2017
Messages
7
Hi everyone,

Im trying to figure out a way to make a Table into a list.

Example:

PeterAndersMikaelJohn
Criteria111
Criteria211
Criteria3111
Criteria411

<tbody>
</tbody>


What I know want to do is the following if the cell has "1" with a formula if possible:

PeterCriteria1
PeterCriteria3
AndersCriteria2
AndersCriteria3
AndersCriteria4
MikaelCriteria1
MikaelCriteria3
JohnCriteria2
JohnCriteria4

<tbody>
</tbody>

I was first thinking with a Index Match but I cant figure this out.

Can anyone help me?

Thanks in advance
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Sheet1 has data, results will be in Sheet2.

Code:
Sub test()
Dim cnt As Long, i As Long, j As Long, LR As Long
Dim rng As Range, c
Dim ws1 As Worksheet, ws2 As Worksheet
Set ws1 = Sheets("Sheet1")
Set ws2 = Sheets("Sheet2")
With ws1
    For i = 2 To .cells(1, Columns.count).End(xlToLeft).column
        .Range("A1").AutoFilter field:=i, Criteria1:=1
        If WorksheetFunction.Subtotal(3, .Range("A:A")) > 1 Then
            For Each c In .AutoFilter.Range.Columns(1).SpecialCells(xlCellTypeVisible)
                If c <> "" Then
                    With ws2
                        LR = .cells(Rows.count, 1).End(xlUp).row + 1
                        .cells(LR, 2).Value = c.value
                        .cells(LR, 1).Value = ws1.cells(1, i).Value
                    End With
                End If
            Next
        End If
        .Range("A1").AutoFilter
    Next
End With
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,139
Messages
6,123,262
Members
449,093
Latest member
Vincent Khandagale

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top