title: Excel Macro Auto Show/Hide Columns Based on Value in Drop Down List
body: <p>I am trying to create a macro in Excel 2016 that auto shows/hides columns based on a drop down contained in a different cell. The drop down (in cell "K7") is currently using Excel's data validation referencing a range of a few thousand cells (that are text) in a different sheet.</p>
  
  <p>This is my current code (thanks to Busse!) which I know does not have the auto show/hide functionality to instantaneously show/hide dependent on what the user selects in cell "K7":</p>
  
  <pre><code>Sub Hide_Columns_Containing_Value()
  
      Dim c As Range
  
      For Each c In Range("R3:GJU3").Cells
          If c.Value Range("K7").Value Then
              Columns(c.Column).EntireColumn.Hidden = False
          End If
      Next c
  
  End Sub
  </code></pre>
  
  <p>Thanks for the help!</p>