+ Reply to Thread
Results 1 to 10 of 10

Right Click Menu - Adding (Paste Special)

Hybrid View

  1. #1
    Registered User
    Join Date
    07-02-2008
    Location
    Fort Worth, TX
    Posts
    99

    Right Click Menu - Adding (Paste Special)

    I want to add Paste Values to the right click menu in Excel 2007. Can this be done without recording a separate macro to run it? What I mean is If I add the command itself to the right click menu, can it run of of the standard RightClick -> Paste Special -> Values option, or must I record a macro that does those steps each time?
    Last edited by Tirren; 12-30-2008 at 01:55 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492
    Creating a macro and assigning a permanent keyboard shortcut is much less complicated than what you're asking. And in the end activating a keyboard shortcut is the same number of steps as right-click-choose...so, macro gets my vote.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    07-02-2008
    Location
    Fort Worth, TX
    Posts
    99
    Well you can add Paste Values (no macro required) directly to the QAT, in fact you can do any of the paste special functions via the QAT no macro required. I assumed it might be just as easy to add them to the Right Click menu, I just have no clue how to do it. Seems pointless to write another macro, to perform the exact same task.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Tirren,

    I don't have 2007, but it seems reasonable. I have modified the cell context menu many times in Excel 2003 to provide users with faster data entry.

    Sincerely,
    Leith Ross

  5. #5
    Registered User
    Join Date
    07-02-2008
    Location
    Fort Worth, TX
    Posts
    99
    Quote Originally Posted by Leith Ross View Post
    Hello Tirren,

    I don't have 2007, but it seems reasonable. I have modified the cell context menu many times in Excel 2003 to provide users with faster data entry.

    Sincerely,
    Leith Ross
    In 2003, what method did you do for adding an excel pre-programmed feature to the menu. The only method I know currently is recording a separate macro to accomplish the same feat, then adding that macro to the right click menu. Problem is, you can't undo actions done by a macro, so if I make a mistake I cannot easily fix it.

    If I use the paste special function already designed in Excel, then I should be good. I just don't know how to contextually add it to the right click menu. Here is the code that I have to add a pre-programmed macro to the right click... perhaps you can tell me what to edit, to point to the excel function already available:

    Private Sub Workbook_Open()
        Application.CommandBars("Cell").Reset
        With Application.CommandBars("Cell").Controls
            With .Add
                .Caption = "Paste Values"
                .OnAction = ThisWorkbook.Name & "!PasteSpecial"
                .Tag = cControlTag
                .BeginGroup = True
            End With
        End With
    End Sub

  6. #6
    Valued Forum Contributor
    Join Date
    10-15-2007
    Location
    Home
    MS-Off Ver
    Office 2010, W10
    Posts
    373
    Hi Tirren

    Try:

    Application.CommandBars("Cell").Controls.Add Type:=msoControlButton, ID:= 370, Before:=5

  7. #7
    Registered User
    Join Date
    07-02-2008
    Location
    Fort Worth, TX
    Posts
    99
    Quote Originally Posted by lecxe View Post
    Hi Tirren

    Try:

    Application.CommandBars("Cell").Controls.Add Type:=msoControlButton, ID:= 370, Before:=5
    AWESOME! You got it! You also answered a question I had in another post, not sure if you had intended to.

    Might I ask where you find those ID's?

  8. #8
    Valued Forum Contributor
    Join Date
    10-15-2007
    Location
    Home
    MS-Off Ver
    Office 2010, W10
    Posts
    373
    I'm glad it helped.

    I don't have a full list of the ids for excel 2007. You find here a list of the ids for excel 2000. I'm not sure they all work in xl2007 and it doesn't have the paste values. If you find a more recent list please post it.


    http://support.microsoft.com/kb/213552/en-us

  9. #9
    Registered User
    Join Date
    10-01-2012
    Location
    Italia
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Right Click Menu - Adding (Paste Special)

    Thank you very much Tirren !! You saved me !!!
    Last edited by fablepd; 10-01-2012 at 08:11 AM.

  10. #10
    Registered User
    Join Date
    10-01-2012
    Location
    Italia
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Right Click Menu - Adding (Paste Special)

    lecxe i cannot find ID 370 in the support.microsoft.com you gave us ;(
    i'm looking for the "paste as Unicode text" ID. Can you help me please ?
    Thank you very much.

    Fabio

+ 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