+ Reply to Thread
Results 1 to 5 of 5

Code to Interchange Data

  1. #1
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Code to Interchange Data

    Assume I have First Name in the Active Cell and Last Name in the cell next to the Active Cell.

    I want to know how can I write the code that would interchange data between cells.

    I know how to do this on Excel, I just want to know how would I write the code for the same.

    Help Appreciated!
    Cheers!
    Deep Dave

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: Code to Interchange Data

    Hi Deep. This seems to work, assuming names are in A1 and B1.
    Please Login or Register  to view this content.

  3. #3
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Code to Interchange Data

    Here the cells will not always be A1 & B1.

    I had written the below code. I an unable to understand why it isnt working. If you could please tell??

    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor
    Join Date
    11-11-2008
    Location
    Euro
    MS-Off Ver
    2007, 2010
    Posts
    470

    Re: Code to Interchange Data

    Quote Originally Posted by msexcelathome View Post
    Here the cells will not always be A1 & B1.
    I had written the below code. I an unable to understand why it isnt working. If you could please tell??
    you should add Exit Sub, before label Handler, like this
    Please Login or Register  to view this content.
    however, we need only one temporary variable, like this

    Please Login or Register  to view this content.
    Last edited by tigertiger; 04-12-2013 at 10:24 AM.
    Best regard, -)iger-/iger
    If you are pleased with a solution mark your post SOLVED.

  5. #5
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Code to Interchange Data

    Worked!

    Thank You.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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