title: Run-time error '1004' : Method 'Range' of object'_Global' failed
body: <p>I have a problem with excel, with a form that generates a reference no. But when I try to generate the reference no. it has an error message saying : </p>
  
  <blockquote>
    <p>Run-time error '1004' : Method 'Range' of object'_Global' failed</p>
  </blockquote>
  
  <p>When I click on Debug button , it shows the code as below:</p>
  
  <p>It highlight the error on 4th line of the code       </p>
  
  <pre><code>Sub clearTemplate()
      ' Clear Template Content
      Range(inputTemplateHeader) = NO_ENTRY
      Range(inputTemplateContent) = NO_ENTRY     - (highlighted error)
  End Sub
  
  Sub clearRefNo()
      ' Clear cell G2 reference number
      Range(cellRefNo) = NO_ENTRY
  
      ' Open "Report_ref_no.xls"
      If Not (IsFileOpen) Then Workbooks.Open filename:=ThisWorkbook.Path &amp; "\" &amp; FACCESS
  
      ' Activate "Report_ref_no.xls"
      Windows(FACCESS).Activate
  
      ' Access column D
      Range(cellFirstRefNo).Select
      Selection.End(xlDown).Select
  
      If refNo = Cells(ActiveCell.Row, ActiveCell.Column - 1).Value Then
          ' Log Development Code column
          Cells(ActiveCell.Row, ActiveCell.Column) = NO_ENTRY
  
          ' Log Issuer column
          Cells(ActiveCell.Row, ActiveCell.Column + 1).Value = NO_ENTRY
  
          ' Log Date column
          Cells(ActiveCell.Row, ActiveCell.Column + 2).Value = NO_ENTRY
      End If
  
      ' Save &amp; Close workbook
      ActiveWindow.Close True
  End Sub
  </code></pre>
  
  <p>Can anyone help me with this problem ? I don't know what has gone wrong?</p>