transpose two rows of data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have data on two rows and I want to flip them., i.e., I want to move the
data in row 1 to row 2 and vice versa. Any way to do this? All I've been
able to do is a cut and paste, which is really time-consuming. Thanks in
advance for your help!
 
Copy the data, click on a new cell, and go to Edit >
Paste Special > Transpose.

HTH
Jason
Atlanta, GA
 
One way:

This is almost instantaneous:

Public Sub FlipRowValues(Optional rFirstRow As Range, _
Optional rSecondRow As Range)
Dim vTemp As Variant
If rFirstRow Is Nothing Then _
Set rFirstRow = Selection(1, 1).EntireRow
If rSecondRow Is Nothing Then _
Set rSecondRow = Selection(2, 1).EntireRow
vTemp = rSecondRow.Value
rSecondRow.Value = rFirstRow.Value
rFirstRow.Value = vTemp
End Sub

you can assign a keyboard shortcut or a toolbar to this macro, or run it
from Tools/Macro/Macros (it won't show up in the list since it has
arguments, but you can type FlipRowValues in the text box and hit Run).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top