You can't have a UDF that does paste special|transpose.
You could use the builtin excel function =transpose(), but this leaves a
formula.
You could have a Subroutine that does the edit|paste special|transpose. If you
want that, record a macro after you've done the copy and selected the cell to
paste special.
Suppose your range is 5 rows by 10 columns
select a range 10 rows by 5 columns and type, but do NOT enter the formula
Press Shift+Ctrl+Enter
The code to do the transpose command would be:
Sub Transpose()
myRange = InputBox("Enter the address of the range to transpose",
"Transpose")
Range(myRange).Copy
myTarget = InputBox("Enter the destination cell address.", "Transpose")
Range(myTarget).PasteSpecial Transpose:=True
End Sub
This is very simplistic, it would be better done with a user form. But you
might as well do it manually because its faster.
i need it to be automated without the array thing {}
i made this formula that will transpose a row to col
INDIRECT("R"&ROW($A$1)&"c"&COLUMN(INDIRECT(ADDRESS(ROW($A
$1),COLUMN(A1)+ROW(A1)-1,4))),FALSE)
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.