Hello,
I've already have a VBA running which is only selecting data when in row 1 c.Value=1 is given, but I would like to enhance this VBA to also look in Column A if there is a 1 and only take the cells with 1 in the column and in the row. In the table below only the once with Yes should be copied.
<tbody>
</tbody>
Already running VBA is the following, can anybody help me with this one?
For Each c In Intersect(.Range("1:1"), .UsedRange)
If c.Value = 1 Then
If Not rnga Is Nothing Then
Set rnga = Union(rnga, Intersect(c.EntireColumn, .Range("2:500")))
Else
Set rnga = Intersect(c.EntireColumn, .Range("2:500"))
End If
End If
Next
End With
I've already have a VBA running which is only selecting data when in row 1 c.Value=1 is given, but I would like to enhance this VBA to also look in Column A if there is a 1 and only take the cells with 1 in the column and in the row. In the table below only the once with Yes should be copied.
1 | 0 | 1 | |
0 | No | No | No |
1 | Yes | No | Yes |
1 | Yes | No | Yes |
0 | No | No | No |
<tbody>
</tbody>
Already running VBA is the following, can anybody help me with this one?
For Each c In Intersect(.Range("1:1"), .UsedRange)
If c.Value = 1 Then
If Not rnga Is Nothing Then
Set rnga = Union(rnga, Intersect(c.EntireColumn, .Range("2:500")))
Else
Set rnga = Intersect(c.EntireColumn, .Range("2:500"))
End If
End If
Next
End With