VBA | How to Copy value from Cell to Cell in Excel
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. Following is the code i tried- 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 CodeJockey No need to use the Range.Copy method. Try this: Dim a As Variant a = Cells(x, 1).Value Cells(x, 2).Value = a If you want to retain ALL of the values, you will need to use an array: Dim x As Long Dim NumRows As Long NumRows = Range("A1", Range(