+ Reply to Thread
Results 1 to 5 of 5

VBA - Swap values in a column with another column

  1. #1
    Registered User
    Join Date
    07-20-2015
    Location
    NYC
    MS-Off Ver
    2010
    Posts
    70

    Exclamation VBA - Swap values in a column with another column

    Hi,
    Please see attached report. I want to have a macro do the following:

    1) Filter column R, to show the ones that say "Canada" on column R.

    2) Then I want to be able to swap the values in the following columns, after its filter to show the ones from Canada only

    H with S
    I with T
    J with U

    Can you help me with that...?

    Thanks,

    Cele
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: VBA - Swap values in a column with another column

    Try this code
    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  3. #3
    Registered User
    Join Date
    07-20-2015
    Location
    NYC
    MS-Off Ver
    2010
    Posts
    70

    Re: VBA - Swap values in a column with another column

    Hmm..for some reason the macro isn't working. Would you mind pasting the file you were working off of, to see if how it works?

  4. #4
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: VBA - Swap values in a column with another column

    The results were put in Sheet2 .. you can change the reference to Sheet1.Range("A2") if you desire..
    Test it again

  5. #5
    Forum Contributor
    Join Date
    08-09-2012
    Location
    British Columbia
    MS-Off Ver
    Excel 2010
    Posts
    189

    Re: VBA - Swap values in a column with another column

    H, I and J are values
    S, T and U are formulas.
    The column R heading is Canada.

    Can you explain what you're actually trying to accomplish here and why only to the filtered rows?

+ 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. I need to swap the values of two column
    By nazaninibb in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-21-2015, 03:54 PM
  2. Swap column order
    By Burt_100 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-03-2015, 11:21 AM
  3. How to Compare Column 12 to values in column 6 while deleting dups from column 12
    By Launchnet in forum Excel Programming / VBA / Macros
    Replies: 33
    Last Post: 12-16-2011, 03:21 AM
  4. Swap and merge column contents
    By naflas in forum Excel General
    Replies: 8
    Last Post: 07-21-2010, 11:42 PM
  5. Swap column Row
    By taylorzzz in forum Excel General
    Replies: 11
    Last Post: 05-04-2010, 04:23 PM
  6. Swap Column to Rows
    By sky in forum Excel General
    Replies: 5
    Last Post: 09-05-2006, 11:50 AM
  7. How to swap around First and Last Names in one column ?
    By Dbase Beginner in forum Excel General
    Replies: 1
    Last Post: 03-07-2005, 11:54 AM

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