+ Reply to Thread
Results 1 to 4 of 4

Macro for one-click paste special transpose

  1. #1
    Victoria @ WB
    Guest

    Macro for one-click paste special transpose

    I would like to write a macro to assign to a toolbar button. I would like it
    to Paste_Special Transpose in the active cell.

    Seems simple enough, but I keep failing.

    Thanks for any help.

  2. #2
    Dave Peterson
    Guest

    Re: Macro for one-click paste special transpose

    Maybe...

    Option Explicit
    Sub testme()

    On Error Resume Next
    ActiveCell.PasteSpecial Transpose:=True
    If Err.Number <> 0 Then
    MsgBox "Something bad happened!"
    Err.Clear
    End If
    On Error GoTo 0

    End Sub

    Lots of things can go wrong--nothing currently copied, the paste won't fit, ...

    So I just let it fail and issue a warning.



    Victoria @ WB wrote:
    >
    > I would like to write a macro to assign to a toolbar button. I would like it
    > to Paste_Special Transpose in the active cell.
    >
    > Seems simple enough, but I keep failing.
    >
    > Thanks for any help.


    --

    Dave Peterson

  3. #3
    Victoria @ WB
    Guest

    Re: Macro for one-click paste special transpose

    It worked. Thanks.

    "Dave Peterson" wrote:

    > Maybe...
    >
    > Option Explicit
    > Sub testme()
    >
    > On Error Resume Next
    > ActiveCell.PasteSpecial Transpose:=True
    > If Err.Number <> 0 Then
    > MsgBox "Something bad happened!"
    > Err.Clear
    > End If
    > On Error GoTo 0
    >
    > End Sub
    >
    > Lots of things can go wrong--nothing currently copied, the paste won't fit, ...
    >
    > So I just let it fail and issue a warning.



  4. #4
    Dave Peterson
    Guest

    Re: Macro for one-click paste special transpose

    You're welcome.

    Victoria @ WB wrote:
    >
    > It worked. Thanks.
    >
    > "Dave Peterson" wrote:
    >
    > > Maybe...
    > >
    > > Option Explicit
    > > Sub testme()
    > >
    > > On Error Resume Next
    > > ActiveCell.PasteSpecial Transpose:=True
    > > If Err.Number <> 0 Then
    > > MsgBox "Something bad happened!"
    > > Err.Clear
    > > End If
    > > On Error GoTo 0
    > >
    > > End Sub
    > >
    > > Lots of things can go wrong--nothing currently copied, the paste won't fit, ...
    > >
    > > So I just let it fail and issue a warning.


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1