Sub Rowtocolform()
'
' to swap rows to columns, select the formula you want to swap, then run the macro,
' the macro will ask you where you want to put the data, and it will copy the data to that
' location using the location as The top left corner of the array, but with the rows swapped for columns
Dim outarr() As Variant
Dim plac As Range
firstrow = Selection.Row
rc = Selection.Rows.Count - 1
LastRow = Selection.Row + rc
Dim ActSheet As Worksheet
Dim SelRange As Range
Set ActSheet = ActiveSheet
Set SelRange = Selection
rowc = Selection.Rows.Count
colc = Selection.Columns.Count
ReDim outarr(1 To colc, 1 To rowc)
For i = 1 To rowc
For j = 1 To colc
outarr(j, i) = SelRange(i, j).Formula
Next j
Next i
'plact = Selection.Address
Dim oRangeSelected As Range
On Error Resume Next
Set oRangeSelected = Application.InputBox("Please select a cell for the top left of the array!", _
"SelectARAnge Demo", Selection.Address, , , , , 8)
If oRangeSelected Is Nothing Then
' MsgBox "It appears as if you pressed cancel!"
Else
' MsgBox "You selected: " & oRangeSelected.Address(External:=True)
firstrow = oRangeSelected.Row
firstcol = oRangeSelected.Column
Range(Cells(firstrow, firstcol), Cells(firstrow + colc - 1, firstcol + rowc - 1)) = outarr
End If
mm = 1
End Sub