title: Find from InputBox, Select found cell without using .Select
body: <p>I am very new to VBA and need it to perform a series of things in excel.</p>
  <p>I have a spreadsheet with over 10000 rows and need to search it using InputBox (UPC field, input is from a barcode scanner)</p>
  <p>Once it's found, I need it to select the row of the found cell, copy it, and paste it to another sheet.</p>
  <p>This process should loop until the user cancels the InputBox</p>
  <p>I have successfully done this, but it seems very inconsistent; it routinely gives me an error on the SelectCells.Select line, but not every time.</p>
  <p>Any help would be greatly GREATLY appreciated.</p>
  <p>This is what I have so far:</p>
  <pre><code>Sub Scan()
  
  Do Until IsEmpty(ActiveCell)
      Dim Barcode As Double
      Barcode = InputBox(&quot;Scan Barcode&quot;)
      Dim ws As Worksheet
      Dim SelectCells As Range
      Dim xcell As Object
      
      Set ws = Worksheets(&quot;Sheet1&quot;)
  
  For Each xcell In ws.UsedRange.Cells
      If xcell.Value = Barcode Then
          If SelectCells Is Nothing Then
          Set SelectCells = Range(xcell.Address)
          Else
          Set SelectCells = Union(SelectCells, Range(xcell.Address))
          End If
      End If
  Next
  
  SelectCells.Select
  Set SelectCells = Nothing
   ActiveCell.Rows(&quot;1:1&quot;).EntireRow.Select
      Selection.Copy
      Sheets(&quot;Sheet2&quot;).Select
      ActiveSheet.Paste
      Sheets(&quot;Sheet1&quot;).Select
      
      
  Loop
  
  End Sub
  </code></pre>