I need flexibility in terms of adding more columns to the table and certainly my choices will increase (so the matrix will increase).
According to your attachment as a VBA starter :
PHP Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim V, A$
If Target.Address <> "$B$2" Then Exit Sub
Application.ScreenUpdating = False
[A4].CurrentRegion.EntireColumn.Hidden = False
V = Application.Match(Target.Value2, [A4].CurrentRegion.Columns(2), 0)
If IsNumeric(V) Then
A = Range(Cells(3 + V, 3), Cells(3 + V, 2).End(xlToRight)).Address
V = Filter(Evaluate("IF(" & A & "=0,ADDRESS(1,COLUMN(" & A & ")))"), False, False)
If UBound(V) > -1 Then Range(Join(V, ",")).EntireColumn.Hidden = True
End If
Application.ScreenUpdating = True
End Sub
► Do you like it ? ► ► So thanks to click on bottom left star icon « ★ Add Reputation » ! ◄ ◄
Bookmarks