+ Reply to Thread
Results 1 to 7 of 7

Swap Selected Visible Cells to Values to right of the Selection

  1. #1
    Forum Contributor
    Join Date
    09-04-2013
    Location
    USA
    MS-Off Ver
    Excel 365
    Posts
    263

    Swap Selected Visible Cells to Values to right of the Selection

    I am using the code below to "swap" the selected cell values in a column with the ones to the right of the selection. It works fine on unfiltered sheet, but if I apply an Autofilter, it copies both visible and hidden cells, and I only want to swap visible cells. Any ideas what to modify? Thanks.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Swap Selected Visible Cells to Values to right of the Selection

    Hi,
    check if this is what you want

    Please Login or Register  to view this content.
    If you are pleased with a member's answer then use the Star icon to rate it.

  3. #3
    Forum Contributor
    Join Date
    09-04-2013
    Location
    USA
    MS-Off Ver
    Excel 365
    Posts
    263

    Re: Swap Selected Visible Cells to Values to right of the Selection

    I had previously tried that, and it indeed is only affecting visible cells. The only problem is it is changing them all to the last value in the selection. Not sure why it is doing that..

  4. #4
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Swap Selected Visible Cells to Values to right of the Selection

    hm, for me it works just fine. check attached file. maybe i don't get your need right
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    09-04-2013
    Location
    USA
    MS-Off Ver
    Excel 365
    Posts
    263

    Re: Swap Selected Visible Cells to Values to right of the Selection

    Using Excel 2010.

    Regarding your macro, your second column has all zeros (0) in it. With all zeros, it works. But, if you put values in there (e.g. 1,2,3), it does not, as it mixes them up..

  6. #6
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Swap Selected Visible Cells to Values to right of the Selection

    I see. Check this now
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    09-04-2013
    Location
    USA
    MS-Off Ver
    Excel 365
    Posts
    263

    Re: Swap Selected Visible Cells to Values to right of the Selection

    Excellent. It worked!!! Thanks for your persistence..

+ 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. [SOLVED] Copy/Pasting Values from visible cells (using autofilter) to visible cells
    By evakotsi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-23-2012, 07:49 AM
  2. send email to selected cells, pull values from selection
    By Armitage2k in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-26-2011, 12:06 PM
  3. Copy Visible cells and paste values only to visible target cells
    By wotadude in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-28-2010, 04:09 AM
  4. Hidden and visible sheets-swap
    By KausBorealis in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-20-2008, 03:59 PM
  5. [SOLVED] Selected cells not visible
    By LAUR in forum Excel General
    Replies: 1
    Last Post: 05-15-2006, 02:45 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