0

I am trying to transpose the last row of my spreadsheet so that it becomes a column.

I have started such that I retrieve the last column/row number of the spreadsheet but I don't know how to make it an array to transpose it with Application.transpose(myarray) or Application.WorksheetFunction.Transpose(myarray)

Dim lRow As Long, lCol As Long
lRow = Cells(Rows.Count, 1).End(xlUp).Row
lCol = Cells(1, Columns.Count).End(xlToLeft).Column

Any tips?

Thanks

pdx
  • 303
  • 7
  • 18

1 Answers1

1

Starting with:

enter image description here

Running:

Sub xPose()
    Dim r As Range, N As Long
    N = Cells(Rows.Count, "A").End(xlUp).Row
    Set r = Cells(N, 1).EntireRow

    r.Copy
    Cells(N + 1, 1).PasteSpecial Transpose:=True
    r.Delete
End Sub

will produce:

enter image description here

Gary's Student
  • 95,722
  • 10
  • 59
  • 99