Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-25-2021, 11:22 PM
Marcia's Avatar
Marcia Marcia is offline Paste value of selected cell to adjacent cell Windows 10 Paste value of selected cell to adjacent cell Office 2019
Expert
Paste value of selected cell to adjacent cell
 
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Paste value of selected cell to adjacent cell How to paste the value of a selected cell to another sheet? Learner7 Excel Programming 3 06-30-2019 10:35 PM
Paste value of selected cell to adjacent cell Fill blank cell with value from adjacent cell kevinbradley57 Excel Programming 2 04-17-2018 08:40 AM
IF adjacent cell empty Copy from Other Column ChrisOK Excel Programming 8 03-08-2018 09:17 PM
Increase number in cell, based on value in adjacent cell scottyb Excel 3 02-02-2017 03:51 AM
Paste value of selected cell to adjacent cell How to conditionally format cells in Col. A if it matches adjacent cell in Col. B? alshcover Excel 2 06-03-2014 12:50 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:35 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft