title: Run-time error '1004' when I try to put value in
body: <p>When I try to replace the <code>&quot;A3&quot;</code> with <code>DES</code> ( <code>DES = rng.Cells(3, 1)</code>) inside  <code>.Range(ThisWorkbook.Sheets(1).Range(&quot;A3&quot;))</code> I get run-time error 1004 and I don't know why.</p>
  <p>The value of cell A3 in Sheet1 is B2.</p>
  <p>Would anyone be so kind enough to explain why or what I'm doing wrong?
  Below you can also find the complete script.</p>
  <pre><code>Sub ImportTBL()
      
      Dim sourceSheet As Worksheet
      Dim QT As QueryTable
      Dim destCell As Range
      Dim qtResultRange As Range
      Dim TBL As String
      Dim URL As String
      Dim DES As String
      Dim COL As String
      
      Set sourceSheet = Sheet5
      Dim rng As Range: Set rng = Application.Range(&quot;Sheet1!A1&quot;)
      Dim cel As Range
          
          For Each cel In rng.Cells
              TBL = rng.Cells(1, 1)
              URL = rng.Cells(2, 1)
              DES = rng.Cells(3, 1)
              COL = rng.Cells(4, 1)
          Next cel
           
      With sourceSheet
          Set destCell = .Range(ThisWorkbook.Sheets(1).Range(&quot;A3&quot;))
          On Error Resume Next
          .ListObjects(TBL).Delete
          On Error GoTo 0
      End With
      
      Set QT = destCell.Worksheet.QueryTables.Add(Connection:=&quot;URL;&quot; &amp; URL, Destination:=destCell)
      
      With QT
          .RefreshStyle = xlOverwriteCells
          .WebFormatting = xlNone
          .WebSelectionType = xlSpecifiedTables
          .WebTables = ThisWorkbook.Sheets(1).Range(&quot;A4&quot;)
          .BackgroundQuery = False
          .Refresh
          Set qtResultRange = .ResultRange
          .Delete
      End With
      
      With destCell
          .Worksheet.ListObjects.Add(xlSrcRange, .CurrentRegion, , xlYes).Name = TBL
          sourceSheet.ListObjects(TBL).ShowAutoFilterDropDown = False
      End With
  
  End Sub
  </code></pre>