• Cut Row and Paste as Column (Excel 2000 or XP)

    Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Cut Row and Paste as Column (Excel 2000 or XP)

    Author
    Topic
    #393950

    Does anyone know a way to cut an entire row and paste it as a column in an Excel Worksheet?

    Viewing 3 reply threads
    Author
    Replies
    • #718353

      Does this do what you want?
      Steve

      Option Explicit
      Sub TransposeRowToColumn()
          Dim rngS As Range
          Dim rngD As Range
          Dim vArray
          Dim i As Integer
          Set rngS = Application.InputBox("What is the Source Range", Type:=8)
          Set rngD = Application.InputBox("What is the Destination", Type:=8)
          Set rngD = rngD.Cells(1, 1)
          vArray = rngS
          rngS.ClearContents
          
          For i = 1 To UBound(vArray, 2)
              rngD.Offset(i - 1, 0) = vArray(1, i)
          Next
      End Sub
    • #718354

      Does this do what you want?
      Steve

      Option Explicit
      Sub TransposeRowToColumn()
          Dim rngS As Range
          Dim rngD As Range
          Dim vArray
          Dim i As Integer
          Set rngS = Application.InputBox("What is the Source Range", Type:=8)
          Set rngD = Application.InputBox("What is the Destination", Type:=8)
          Set rngD = rngD.Cells(1, 1)
          vArray = rngS
          rngS.ClearContents
          
          For i = 1 To UBound(vArray, 2)
              rngD.Offset(i - 1, 0) = vArray(1, i)
          Next
      End Sub
    • #718415

      You can’t do that directly. You either have to use VBA like Steve showed you, or do it in a three step process. Select the data to be moved and do Edit/Copy. Select the cell in the column where you want the data to start. “Select PasteSpecial…”, tick Transpose at the bottom of the dialog box, and click OK. Now, delete the original data.

    • #718416

      You can’t do that directly. You either have to use VBA like Steve showed you, or do it in a three step process. Select the data to be moved and do Edit/Copy. Select the cell in the column where you want the data to start. “Select PasteSpecial…”, tick Transpose at the bottom of the dialog box, and click OK. Now, delete the original data.

    Viewing 3 reply threads
    Reply To: Cut Row and Paste as Column (Excel 2000 or XP)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: