title: VBA: Automatically hide column when value in range is too small
body: <p>I have a timeline, my goal is to automatically hide the columns not needed if the value in the timeline is smaller than PredevStart</p>
  <p>In this scenario PredevStart = - 11, so all the columns that have a value of smaller than -11 in the timeline need to be hidden.</p>
  <p>I prepared a sub below, which produces a 1004 error in row 4 - where is my mistake?</p>
  <pre><code>Option Explicit
  
  Sub Hide_DevCol()
  
      Dim i, PredevStart As Long
      
      For i = 11 To 100
      
      If Worksheets(&quot;Projections&quot;).Cells(14, i).Value &lt; Range(PredevStart).Value Then
      Worksheets(&quot;Projections&quot;).columns(i).Hidden = True
      
      End If
      
      Next
  
  End Sub
  </code></pre>