title: Unable to copy data from another sheet to main sheet. Error on execution vba subscript out of range error 9 on calling sub copy
body: <p>to get the data from website in sheet2</p>
  
  <pre><code>Sub Button1_Click()
  
      strSearch = Range("a1")
      With Sheet2.QueryTables.Add( _
                       Connection:="URL;https://iban.codes/validate/ " &amp; strSearch &amp; "&amp;safe=active", _
                       Destination:=Sheet2.Range("a5"))`
  
         .BackgroundQuery = True
          .TablesOnlyFromHTML = True
          .Refresh BackgroundQuery:=False
          .SaveData = True
      End With
      Call copy
      Application.ScreenUpdating = True
      Sheet2.UsedRange.Delete
      End Sub
  </code></pre>
  
  <p>to copy the data from sheet2 to sheet1</p>
  
  <pre><code>Sub copy()
          Sheets("Sheet2").Range("A5").copy Destination:=Sheets("Sheet1").Range("A5") 
   End Sub
  </code></pre>