transpose data between columns, rows or cells

  • Thread starter Thread starter jonnel
  • Start date Start date
J

jonnel

Hi,

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

Tnx,
Joh
 
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
 
Back
Top