+ Reply to Thread
Results 1 to 2 of 2

transpose data between columns, rows or cells

  1. #1
    Registered User
    Join Date
    07-31-2006
    Posts
    3

    transpose data between columns, rows or cells

    Hi,

    How can I switch data between cells, rows or columns in one step? For instance, if I want to switch the contents of cells A1 and B1, how do I do that without having to retype everyting, and without having to use a third column (that's what I do now: first I copy B1 to C1, then A1 to B1, then C1 to A1, then delete C1 - this method is obviously very tedious...).

    Tnx,
    John

  2. #2
    Bernard Liengme
    Guest

    Re: transpose data between columns, rows or cells

    Insert a new column; fill with integers 1,2,3 and do a sort on this and the
    column of interest.
    Delete the helper column when done.

    OR use this subroutine with the first of the two cells as the activecell

    Sub transpose()
    Set cell1 = ActiveCell
    Set cell2 = ActiveCell.Offset(1, 0)
    temp = cell1
    ActiveCell = cell2
    ActiveCell.Offset(1, 0) = temp
    End Sub

    Change the (1,0) to (0,1) to transpose horizontally
    --
    Bernard V Liengme
    www.stfx.ca/people/bliengme
    remove caps from email

    "jonnel" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi,
    >
    > How can I switch data between cells, rows or columns in one step? For
    > instance, if I want to switch the contents of cells A1 and B1, how do I
    > do that without having to retype everyting, and without having to use a
    > third column (that's what I do now: first I copy B1 to C1, then A1 to
    > B1, then C1 to A1, then delete C1 - this method is obviously very
    > tedious...).
    >
    > Tnx,
    > John
    >
    >
    > --
    > jonnel
    > ------------------------------------------------------------------------
    > jonnel's Profile:
    > http://www.excelforum.com/member.php...o&userid=36946
    > View this thread: http://www.excelforum.com/showthread...hreadid=566598
    >




+ 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