title: Copy cells in column M that start with "xx" and paste them into another sheet
body: <p>I am trying to make a button that will find all cells in column H starting with rm and copy them from one sheet to another.</p>
  
  <p><a href="https://i.stack.imgur.com/77wQV.png" rel="nofollow noreferrer">sheet2 column M</a>
  would go to
  <a href="https://i.stack.imgur.com/axY1i.png" rel="nofollow noreferrer">sheet 1 column A</a></p>
  
  <pre><code>Dim i As Variant
  Dim rng As Range
  
  Set x = Range("m" &amp; i)
  
  If Left(rng.Value, 2) = "rm" Then
  For Each i In x
  Worksheets("scope sheet").Range("A5").Value = Range(i)
  Next i
  End If
  </code></pre>
  
  <p>this gives an error "method 'range' of Object '_global' failed."</p>
  
  <p>if i add a <code>With</code> statement i get "subscript out of range."</p>
  
  <p>does anyone know a work around.</p>