+ Reply to Thread
Results 1 to 8 of 8

detect if the Paste Special command in Undo stack had Transpose as TRUE or FALSE

  1. #1
    Registered User
    Join Date
    06-13-2022
    Location
    Brazil
    MS-Off Ver
    365
    Posts
    2

    detect if the Paste Special command in Undo stack had Transpose as TRUE or FALSE

    Hi,
    I wonder if is there a way to "listen' to a PasteSpecial command and its parameters in excel? I'm writing a vba code to manage the Range.PasteSpecial method and realized I need a way to know if the Transpose parameter of the action defined by the user is true or false, so I can treat the source data accordingly. Offcourse, since I don't know when Transpose is TRUE, this piece of code below does not really work.

    Please Login or Register  to view this content.
    Last edited by tisouza; 06-13-2022 at 01:51 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    10-12-2021
    Location
    CT
    MS-Off Ver
    365
    Posts
    462

    Re: detect if the Paste Special command in Undo stack had Transpose as TRUE or FALSE

    TransBool will now be TRUE or FALSE depending on whether or not the PasteSpecial was transposed or not...
    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    10-12-2021
    Location
    CT
    MS-Off Ver
    365
    Posts
    462

    Re: detect if the Paste Special command in Undo stack had Transpose as TRUE or FALSE

    & here is your code properly indented...
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    06-13-2022
    Location
    Brazil
    MS-Off Ver
    365
    Posts
    2

    Re: detect if the Paste Special command in Undo stack had Transpose as TRUE or FALSE

    Thank you for the help with indenting.
    It seems to me that the value for the boolean of transpositon, which I itended to keep in 'Transpose' in the same way as you put in 'TransBool', remains undefined. I still do not understand how to capture this boolean from the action of Copy>PasteSpecial and assign it to the variable "Transpose".

  5. #5
    Valued Forum Contributor
    Join Date
    10-12-2021
    Location
    CT
    MS-Off Ver
    365
    Posts
    462

    Re: detect if the Paste Special command in Undo stack had Transpose as TRUE or FALSE

    you can create a function called 'Transpose'

    i.e.

    Please Login or Register  to view this content.
    and run it in your module whenever you want

  6. #6
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: detect if the Paste Special command in Undo stack had Transpose as TRUE or FALSE

    Quote Originally Posted by tisouza View Post
    Hi,
    I wonder if is there a way to "listen' to a PasteSpecial command and its parameters in excel?
    In a word, no. And any sort of Paste Special, will appear as simply that in the Undo list.
    Rory

  7. #7
    Valued Forum Contributor
    Join Date
    10-12-2021
    Location
    CT
    MS-Off Ver
    365
    Posts
    462

    Re: detect if the Paste Special command in Undo stack had Transpose as TRUE or FALSE

    Whenever you write "Transpose" in a module, it will execute the function above... it's not a variable but it sort of acts like one

  8. #8
    Valued Forum Contributor
    Join Date
    10-12-2021
    Location
    CT
    MS-Off Ver
    365
    Posts
    462

    Re: detect if the Paste Special command in Undo stack had Transpose as TRUE or FALSE

    Since you changed your title, my posts are no longer relevant

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. If command returning false when true
    By mysticizmo in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-25-2019, 03:00 PM
  2. macro paste values and keep Undo stack
    By HengeN in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-31-2017, 04:32 AM
  3. Command Button True/False States
    By HangMan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-19-2011, 06:08 PM
  4. Replies: 2
    Last Post: 02-19-2007, 04:53 PM
  5. Cut - Special paste - Transpose ?
    By Jacquesvs in forum Excel General
    Replies: 1
    Last Post: 01-26-2007, 03:13 AM
  6. Paste Special / transpose
    By Ron Carr in forum Excel General
    Replies: 2
    Last Post: 02-24-2006, 02:15 PM
  7. Paste Special Transpose
    By Brian in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-29-2005, 11:05 AM

Tags for this Thread

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