title: VBA | How to Copy value from Cell to Cell in Excel
body: <p>I want to copy a cell value to another cell, but I want to retain the value in a variable so I can use it as per requirement.</p>
  
  <p>Following is the code i tried-<br/></p>
  
  <pre><code>Private Sub CommandButton1_Click()
  NumRows = Range("A1", Range("A1").End(xlDown)).Rows.Count
  For x = 1 To NumRows
      a= Cells(x, 1).Value.Copy
      Cells(x, 2).Value= a.PasteSpecial
  Next
  End Sub
  </code></pre>