title: macro to delete rows between named ranges in excel
body: <p>How do I delete all rows between named ranges?</p>
  
  <p>I have a scenario below </p>
  
  <p>Name Range 1 : SUBHEADER_001 (A1:E1). Displays Headers
  Name Range 2 : SUBFOOTER_001 (A40:E40). Displays legends and dates.  </p>
  
  <p>Between these ranges I am inserting data from sql server. The cell ranges of the SUBFOOTER_001 will change depending on the database records inserted. </p>
  
  <p>I would like to know how to delete these database values between named ranges SUBHEADER_001 and SUBFOOTER_001 . Thank you.</p>
  
  <p>I have googled regarding this but came across the below code snippet which will delete all rows below the range. </p>
  
  <pre><code>Rows(Range("MYRANGE").Cells(Range("MYRANGE").Rows.Count, 1).Row + 1 &amp; ":65536").Delete
  </code></pre>