title: Name a Cell Range After Checking it Doesn't Have a Range Name
body: <p>I'm trying to cycle through a selection of cells and rename those cells based on text values on the spreadsheet.</p>
  <pre class="lang-vb prettyprint-override"><code>Sub naming()
  
      Dim cel As Range
      Dim selectedRange As Range
      Dim to_offset As Integer
  
      Set selectedRange = Application.Selection
  
      Answer = InputBox(&quot;Column Where Named Are?&quot;)
      col_number = Range(Answer &amp; 1).Column
  
      For Each cel In selectedRange.Cells
          cel.Name.Delete
          to_offset = col_number - cel.Column
          cel.Name = cel.Offset(0, to_offset).Value
      Next cel
  
  End Sub
  </code></pre>
  <p>The delete command is the problem - so I thought I'd check for names using Len() but get a 1004 error.</p>
  <p>If there are no names already defined for the cell it works (but I can't leave the delete code in).<br />
  If there are names already defined for the cell it works (and I use the delete).</p>
  <p>I need to use the delete for existing names - but have it step over blank names.</p>