Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Excel Macro for paste values as transpose

Posted on 2016-09-16
6
Medium Priority
?
287 Views
Last Modified: 2016-10-05
I need values from column M82 : T82 to be pasted in the row L83 : L90. I have large amount of data to be pasted in this way. I tried some macros but tis not working.Can anyone help me?
0
Comment
Question by:Anu G
6 Comments
 
LVL 27

Assisted Solution

by:ProfessorJimJam
ProfessorJimJam earned 500 total points (awarded by participants)
ID: 41801267
Dim X() As Variant
Dim y() As Variant
X = ActiveSheet.Range("M82:T82").Value2
y = Application.Transpose(X)
0
 
LVL 53

Assisted Solution

by:Rgonzo1971
Rgonzo1971 earned 500 total points (awarded by participants)
ID: 41801318
Hi,

pls try
    Range("M82:T82").Copy
    Range("L83").PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=True

Open in new window

Regards
0
 
LVL 33

Accepted Solution

by:
Subodh Tiwari (Neeraj) earned 500 total points (awarded by participants)
ID: 41801362
Since you are trying to paste values, try this.....

Range("M82:T82").Copy
Range("L83").PasteSpecial Paste:=xlPasteValues, Transpose:=True
Application.CutCopyMode = 0

Open in new window

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 34

Expert Comment

by:Rob Henson
ID: 41801500
I have large amount of data

M82 : T82 is only 8 cells, not exactly a large amount of data. Please expand on how this is to be used for a large amount of data.

Thanks
Rob H
0
 
LVL 27

Assisted Solution

by:Glenn Ray
Glenn Ray earned 500 total points (awarded by participants)
ID: 41802405
^I agree with Rob.  Your example seems easy enough to just do manually, but I presume you want to be able to repeat this function quickly rather than use existing shortcut key sequences.

In Excel 2010-2013, after copying, the Alt-key sequence is just: [Alt],H,V,S,V,E

However, if you're wanting to get it down to one keystroke combination, add the following code to your workbook (or Personal workbook to make it global) and then assign a shortcut key combination using the Macro Options:
EE-AssignShortcutKeys2.jpg
This code will transpose ANY copied range, anchored at the active cell.
Sub PasteTranspose()
    ActiveCell.PasteSpecial Paste:=xlPasteValues, Transpose:=True
End Sub

Open in new window

0
 
LVL 33

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41829540
All the chosen answers addressed the issue.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question