How do I add a toolbar button to do a Paste Special/Transpose?

K

Keith R

Have you considered adding a (custom) button to the toolbar and just linking
it to a macro?
 
F

Frank Kabel

Hi
try the following:
- insert the following macro in your workbook:
Sub Transpose()
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=True
End Sub

- Assign a button or a shortcut to this macro
 
B

Bernie Deitrick

Suzie,

There is no built-in button that you can add, but you can add a custom-macro
button to a toolbar (rt-click a toolbar, and choose Customize, then click
the Commands tab, select Macro under category, then click on and drag the
Custom Button to where you want it). Link it to the macro below, using
rt-click on the button and "Assign Macro". To run it, you need to first
select the area to copy, and a single cell "anchor" for the paste area using
ctrl-Click.

This will only work on one sheet.

HTH,
Bernie
MS Excel MVP

Sub TransposePaste()
Selection.Areas(1).Copy
Selection.Areas(2).PasteSpecial Transpose:=True
End Sub
 
Top