+ Reply to Thread
Results 1 to 13 of 13

Macro to copy selected cells and paste them in the same row but in a different column

  1. #1
    Forum Contributor
    Join Date
    08-15-2015
    Location
    India
    MS-Off Ver
    Office 2016
    Posts
    221

    Macro to copy selected cells and paste them in the same row but in a different column

    Hi,

    i am trying to work around codes where i copy values from one range of cells and paste it in other column on the same sheet

    Example
    I have Column D with values like 25,35,14,62,25,100,105 in rows D2,D3,D4,D5,D6,D7,D8 Now i will select D2,D3,D4,D5,D6,

    and when i click the macro it should copy the above selected values in Column C in rows C2,C3,C4,C5,C6

    so as u can see jus the column changes but the rows remain the same.

    Also everytime Column D will be the place from where i copy the values and column C will be the place where the values will be pasted

    Any help would be a life savr

  2. #2
    Registered User
    Join Date
    06-21-2016
    Location
    Liverpool, England
    MS-Off Ver
    Office 365 ProPlus
    Posts
    25

    Re: Macro to copy selected cells and paste them in the same row but in a different column

    Hi you could use the following code to achieve what you are trying to do.

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    08-15-2015
    Location
    India
    MS-Off Ver
    Office 2016
    Posts
    221

    Re: Macro to copy selected cells and paste them in the same row but in a different column

    Hi Excel Guru, but every time my selection will be different in column D, can we have the code such that it work for any cellls in column D

  4. #4
    Registered User
    Join Date
    06-21-2016
    Location
    Liverpool, England
    MS-Off Ver
    Office 365 ProPlus
    Posts
    25

    Re: Macro to copy selected cells and paste them in the same row but in a different column

    Hi Nirmall what criteria defines what you select in column D?

  5. #5
    Forum Contributor
    Join Date
    08-15-2015
    Location
    India
    MS-Off Ver
    Office 2016
    Posts
    221

    Re: Macro to copy selected cells and paste them in the same row but in a different column

    Hi Excel Guru, i Jus select the data to copy in column C, now since there will be a lot of entries i need to have a macro

  6. #6
    Registered User
    Join Date
    06-21-2016
    Location
    Liverpool, England
    MS-Off Ver
    Office 365 ProPlus
    Posts
    25

    Re: Macro to copy selected cells and paste them in the same row but in a different column

    Hi Nirmall, if you do not have a predefined criteria to select first then you cannot create a macro to do this otherwise how would the macro know what to select and what to copy and paste?

  7. #7
    Forum Contributor
    Join Date
    08-15-2015
    Location
    India
    MS-Off Ver
    Office 2016
    Posts
    221

    Re: Macro to copy selected cells and paste them in the same row but in a different column

    I will select the cell, then run the macro to paste the cells i have selected

  8. #8
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to copy selected cells and paste them in the same row but in a different column

    Maybe:

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    08-15-2015
    Location
    India
    MS-Off Ver
    Office 2016
    Posts
    221

    Re: Macro to copy selected cells and paste them in the same row but in a different column

    Let me try that

  10. #10
    Forum Contributor
    Join Date
    08-15-2015
    Location
    India
    MS-Off Ver
    Office 2016
    Posts
    221

    Re: Macro to copy selected cells and paste them in the same row but in a different column

    its working great, one last thing, is there are way to paste values with format and not formulas

  11. #11
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to copy selected cells and paste them in the same row but in a different column

    Try:

    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    08-15-2015
    Location
    India
    MS-Off Ver
    Office 2016
    Posts
    221

    Re: Macro to copy selected cells and paste them in the same row but in a different column

    Works like a breeze

  13. #13
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to copy selected cells and paste them in the same row but in a different column

    Glad to hear that. If that solves the issue please mark this thread as SOLVED.

+ 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. Replies: 0
    Last Post: 02-09-2015, 03:37 PM
  2. [SOLVED] Need MACRO to copy the text in the cell left of first selected cells (a column), paste all
    By joobeng in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-16-2013, 06:42 AM
  3. Macro to Copy And Paste selected cells based on "yes"
    By RemoteMed in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-14-2013, 11:26 AM
  4. [SOLVED] copy/paste macro to selected blank cells
    By fumc in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-04-2012, 10:08 PM
  5. Replies: 10
    Last Post: 02-02-2012, 07:03 PM
  6. copy data from selected cells , in selected row and paste it to ms word table ?
    By aaashaaa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-06-2010, 03:25 PM
  7. Macro, Copy Selected Cells Down a Column
    By DB33 in forum Excel General
    Replies: 9
    Last Post: 02-15-2006, 05:35 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