View Single Post
 
Old 08-25-2021, 11:22 PM
Marcia's Avatar
Marcia Marcia is offline Windows 10 Office 2019
Expert
 
Join Date: May 2018
Location: Philippines
Posts: 553
Marcia has a spectacular aura aboutMarcia has a spectacular aura aboutMarcia has a spectacular aura about
Default Paste value of selected cell to adjacent cell

Hi. My macro creation level is limited to recording. I created a code by recording the steps in copying the value of A2 then pasted it in B2. When I selected A16 then ran the macro, the value in A16 was pasted in B2. It should be copied to B16 which is the adjacent cell of A16. How do I edit the line:
Range ("B2").Select?
Code:
Sub Copy()
    Selection.Copy
    Range("B2").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Application.CutCopyMode = False
End Sub
Thank you.
Attached Files
File Type: xlsm vbaCopy.xlsm (15.5 KB, 8 views)
Reply With Quote