+ Reply to Thread
Results 1 to 6 of 6

Macro to swap selected cell contents

  1. #1
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    568

    Macro to swap selected cell contents

    Dear All

    I am looking for a short macro that swaps the cell contents of selected cells.

    For example, I select cells G3, G6, G15, G26 > then I run the macro > it swaps them with K3, K6, K15, K26

    BEFORE:

    Screenshot 2017-11-05 18.11.46.png

    AFTER:

    Screenshot 2017-11-05 18.11.53.png

    Thank you !!

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,596

    Re: Macro to swap selected cell contents

    Here, try this:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Macro to swap selected cell contents

    Try this

    Please Login or Register  to view this content.
    Martin

  4. #4
    Forum Contributor
    Join Date
    12-05-2008
    Location
    Germany
    MS-Off Ver
    365
    Posts
    568

    Re: Macro to swap selected cell contents

    Thanks guys !! Both work great !!

  5. #5
    Registered User
    Join Date
    11-07-2017
    Location
    Indonesia
    MS-Off Ver
    2010
    Posts
    1

    Re: Macro to swap selected cell contents

    Need help. If B2<C2 then swap both cell. Same goes with H2&I2


    A B C D E F G H i j
    1
    2 x2 40 59 R PSOT 1.99 2.38 40.00 59.00 R
    3 50 74 24 O SOIC 1.51 1.82 76.00 24.00 O
    4 98G45 53.2 45.3 R 0805 2.04 2.45 53.20 45.30 R
    5 x1 51.2 47.2 R UNKN 2.05 2.46 51.20 47.20 R

    Thanks for your help.
    Last edited by Dzul; 11-07-2017 at 11:07 PM.

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,596

    Re: Macro to swap selected cell contents

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

+ 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. Swap 2 Selected Names
    By MarvinP in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-19-2016, 03:47 PM
  2. [SOLVED] Swap contents of two cells
    By Sterling in forum Excel General
    Replies: 4
    Last Post: 10-09-2014, 05:50 PM
  3. [SOLVED] Macro to copy selected cells contents to another cell
    By ExcelFailure in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-30-2013, 05:21 AM
  4. [SOLVED] Swap contents of rows in an array
    By engineerlady in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-23-2013, 10:20 AM
  5. Swap and merge column contents
    By naflas in forum Excel General
    Replies: 8
    Last Post: 07-21-2010, 11:42 PM
  6. Swap Cell Contents using VBA
    By konquistador in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-10-2009, 10:03 AM
  7. Swap cell contents with mouse click.
    By ukmxer in forum Excel General
    Replies: 1
    Last Post: 09-19-2007, 04:12 PM

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