title: Hiding empty rows when the value in a cell changes
body: <p>I am trying to make the following code work. It should automatically check and hide empty rows from Range <code>C18</code> to <code>C30</code> when a user selects different radio buttons which are linked to cell <code>c17</code>. which is a start date, so when a user selects different period i want the code to hide/unhide empty rows.</p>
  
  <p>This is the current code and is not working:</p>
  
  <pre><code> Private Sub worksheet_change(ByVal Target As Range)
       If Not Intersect(Target, Range("c17")) Is Nothing Then    
           Range("C18:C30").AutoFilter 1, "&lt;&gt;", , , False  
       End If
   End Sub
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/U73Jx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/U73Jx.png" alt="enter image description here"></a></p>