+ Reply to Thread
Results 1 to 10 of 10

Macro to copy data from one cell to other without deleting original content

  1. #1
    Registered User
    Join Date
    11-12-2019
    Location
    Moravia
    MS-Off Ver
    2016
    Posts
    57

    Macro to copy data from one cell to other without deleting original content

    Hello folks,

    I get stucked with one macro,tried several codes that I found on the net, but nothing works as I need...Here is the problem -

    I have sheet with data and I need macro that do this one -

    In column AF, there are rows and some have already some data and some of them are blank...so for rows, which contains data, I need macro that would check it and if there is in cell any data, go to column Y and copy value from the cell on the same row and paste it to the column AF, same row behind current data...

    Iam little bit desperate about it, I hope that it's written clearly..Thanks for any ideas...

  2. #2
    Forum Guru Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,249

    Re: Macro to copy data from one cell to other without deleting original content

    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    09-30-2019
    Location
    Chicago
    MS-Off Ver
    2016
    Posts
    72

    Re: Macro to copy data from one cell to other without deleting original content

    Hi,

    With the limited info you gave, here is a simple answer.

    Please Login or Register  to view this content.

  4. #4
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,239

    Re: Macro to copy data from one cell to other without deleting original content

    Is this what you mean
    Please Login or Register  to view this content.
    Last edited by nigelog; 11-12-2019 at 09:52 AM.

  5. #5
    Registered User
    Join Date
    11-12-2019
    Location
    Moravia
    MS-Off Ver
    2016
    Posts
    57

    Re: Macro to copy data from one cell to other without deleting original content

    almost perfect armando, but in the column AF,there were already data and that data, which were copied from column Y, they should be pasted behind this original data in column AF....like concatenate two text strings or if you know what i mean...

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,806

    Re: Macro to copy data from one cell to other without deleting original content

    My 2 cents.

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  7. #7
    Registered User
    Join Date
    09-30-2019
    Location
    Chicago
    MS-Off Ver
    2016
    Posts
    72

    Re: Macro to copy data from one cell to other without deleting original content

    Quote Originally Posted by terryjohn View Post
    almost perfect armando, but in the column AF,there were already data and that data, which were copied from column Y, they should be pasted behind this original data in column AF....like concatenate two text strings or if you know what i mean...
    This macro will do it, but every time you click it, it will add onto AF.

    Please Login or Register  to view this content.
    Last edited by armando12345; 11-12-2019 at 10:00 AM.

  8. #8
    Registered User
    Join Date
    11-12-2019
    Location
    Moravia
    MS-Off Ver
    2016
    Posts
    57

    Re: Macro to copy data from one cell to other without deleting original content

    this is what i need..thanks a lot..going to try to understand code

  9. #9
    Registered User
    Join Date
    09-30-2019
    Location
    Chicago
    MS-Off Ver
    2016
    Posts
    72

    Re: Macro to copy data from one cell to other without deleting original content

    Quote Originally Posted by bakerman2 View Post
    My 2 cents.

    Please Login or Register  to view this content.
    QQ Baker. Why did you not have to declare cl, oldval, etc?

    Does VBA automatically know what the variable type is?

  10. #10
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010, 2019
    Posts
    1,996

    Re: Macro to copy data from one cell to other without deleting original content

    I think this non-looping macro will also do what you want...
    Please Login or Register  to view this content.
    Last edited by Rick Rothstein; 11-12-2019 at 01:56 PM. Reason: Added a space between the concatenated cell values

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. complicated macro to copy original data and represent in different format in NEW DATA
    By swilson2006 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 03-17-2018, 10:24 AM
  2. Macro multiply rows and copy exact same data from original row
    By AlexAXL in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-02-2016, 06:46 AM
  3. [SOLVED] Macro to copy cell width to new sheets (ie copy original sheet format)
    By teenyjem in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-20-2013, 07:28 AM
  4. Macro to Copy Values, Insert Row, Paste in Another, Delete Original Data
    By JimPDX in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-23-2013, 05:35 AM
  5. Macro to copy Dyanmic lists then copy sheet and clear the original data
    By twiggywales in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-30-2012, 01:06 PM
  6. Deleting duplicate data - inc original cell
    By blander in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-18-2006, 11:32 AM
  7. Replies: 5
    Last Post: 06-14-2006, 07:10 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1