+ Reply to Thread
Results 1 to 6 of 6

Is there an easy way to swap the contents of two cells in Excel?

  1. #1
    N.B. Yond
    Guest

    Is there an easy way to swap the contents of two cells in Excel?

    I think the subject says it all...

  2. #2
    Dodo
    Guest

    Re: Is there an easy way to swap the contents of two cells in Excel?

    =?Utf-8?B?Ti5CLiBZb25k?= <N.B. Yond@discussions.microsoft.com> wrote in
    news:4C32CCD5-DA6F-43A8-9502-B2348D183371@microsoft.com:

    > I think the subject says it all...
    >


    You could add a button to the sheet with following code behind it:

    Private Sub CommandButton1_Click()
    cel1 = InputBox("First cell?")
    cel2 = InputBox("Second cell?")
    c1 = Range(cel1).Value
    c2 = Range(cel2).Value
    Range(cel1).Value = c2
    Range(cel2).Value = c1
    End Sub

    You will be asked for the 2 cell addresses and the contents will be
    swapped.

  3. #3
    Dave Peterson
    Guest

    Re: Is there an easy way to swap the contents of two cells in Excel?

    manually???

    Edit|copy one cell
    select a helper cell and edit|paste special|values

    edit|copy the second cell
    select the first cell
    edit|paste special|values

    select the helper cell
    edit|copy
    select the second cell
    edit|paste special|Values

    clean up that helper cell.

    N.B. Yond wrote:
    >
    > I think the subject says it all...


    --

    Dave Peterson

  4. #4
    Earl Kiosterud
    Guest

    Re: Is there an easy way to swap the contents of two cells in Excel?

    N. B.,

    You'd like to select the two cells, click the Swap Button, and presto,
    they're swapped. Unfortunately, there ain't such a button.

    A macro could do it.. Then there could be a swap button. Or a keyboard
    shortcut. Or a menu item. If you're interested, post back. We'll write it
    for you. What do you want to do with formatting? Leave in the original
    locations? Or swap that too? What? Should formula cell references to
    these cells get swapped, or remain with the original locations?
    --
    Earl Kiosterud
    www.smokeylake.com

    "N.B. Yond" <N.B. Yond@discussions.microsoft.com> wrote in message
    news:4C32CCD5-DA6F-43A8-9502-B2348D183371@microsoft.com...
    >I think the subject says it all...




  5. #5
    CyberTaz
    Guest

    Re: Is there an easy way to swap the contents of two cells inExcel?

    Select cell'A', Cut.
    Drag cell 'B' to cell 'A', click OK to replace content.
    Click cell 'B', Paste.

    HTH |:>)


    On 7/23/05 8:07 AM, in article
    4C32CCD5-DA6F-43A8-9502-B2348D183371@microsoft.com, "N.B. Yond" <N.B.
    Yond@discussions.microsoft.com> wrote:

    > I think the subject says it all...



  6. #6
    Dave
    Guest

    Re: Is there an easy way to swap the contents of two cells in Exce

    I'm missing something; when I replace A in step 2, the clipboard becomes
    empty so step 3 is not possible.

    "CyberTaz" wrote:

    > Select cell'A', Cut.
    > Drag cell 'B' to cell 'A', click OK to replace content.
    > Click cell 'B', Paste.
    >
    > HTH |:>)
    >
    >
    > On 7/23/05 8:07 AM, in article
    > 4C32CCD5-DA6F-43A8-9502-B2348D183371@microsoft.com, "N.B. Yond" <N.B.
    > Yond@discussions.microsoft.com> wrote:
    >
    > > I think the subject says it all...

    >
    >


+ 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