Results 1 to 1 of 1

Paste to take destination formatting

Threaded View

  1. #1
    Forum Contributor
    Join Date
    09-30-2008
    Location
    Eau Claire, WI
    Posts
    184

    Paste to take destination formatting

    I have a workbook (Excel 2007 .xlsm) that I want to be able to copy information from other workbooks and paste into here. It worked fine, but in order to disable the cut function I had to paste code in there (shown below) and now the right click paste option and the paste button are disabled after I click "copy" from the other workbook. There's nothing in the code that would have disabled the paste function, but when I disable macros to take the code out of play it works again. The worksheets are all locked (except for the user input cells to which I need to paste) and in order to make the below programming worked, I unprotected the workbook to allow the code to run. Any remedies or workarounds to get re-enable pasting from other documents into here?

    IN THIS WORKBOOK
    Private Sub Workbook_Open()
    Run "myMenu"
    End Sub
    
    Private Sub Workbook_Activate()
    Run "myMenu"
    End Sub
    
    Private Sub Workbook_Deactivate()
    Run "myReset"
    End Sub
    
    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Run "myReset"
    End Sub

    IN MODULE
    Private Sub myMenu()
    With Application
    .OnKey "^x", ""
    .CellDragAndDrop = False
    Dim obtn As CommandBarButton
    With .CommandBars("Cell")
    Set obtn = .FindControl(ID:=21)
    obtn.Enabled = False
    End With
    End With
    End Sub
    
    Private Sub myReset()
    With Application
    .OnKey "^x"
    .CellDragAndDrop = True
    .CommandBars("Cell").Reset
    End With
    End Sub
    Last edited by Simon Lloyd; 10-07-2008 at 05:29 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Copy And Paste To New Workbook
    By stevekirk in forum Excel General
    Replies: 3
    Last Post: 03-29-2012, 03:46 AM
  2. Copying worksheets within the same workbook
    By kostas in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-15-2008, 05:51 AM
  3. Copying from one workbook and pasting into another additon to code
    By snordr17 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-30-2008, 05:39 PM
  4. Replies: 3
    Last Post: 06-14-2007, 08:26 AM
  5. Querying Data within an Excel Workbook
    By snowbob23 in forum Excel General
    Replies: 0
    Last Post: 02-21-2007, 05:48 AM

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