+ Reply to Thread
Results 1 to 6 of 6

Disable Cut/Copy

Hybrid View

  1. #1
    Registered User
    Join Date
    04-30-2012
    Location
    Ireland
    MS-Off Ver
    Excel 2010
    Posts
    72

    Post Disable Cut/Copy

    Hey all found this Macro on a search,
    which disables the cut/copy paste feature. Can any one make this work so that it actually disables the this feature but only in Column A

    '*** In the ThisWorkbook Module ***
    Option Explicit 
     
    Private Sub Workbook_Activate() 
         'Force the current selection to be selected, triggering the appropriate
         'state of the cut, copy & paste commands
        Selection.Select 
    End Sub 
     
    Private Sub Workbook_BeforeClose(Cancel As Boolean) 
         'Re-enable the cut, copy & paste commands
        Call ToggleCutCopyAndPaste(True) 
    End Sub 
     
    Private Sub Workbook_Deactivate() 
         'Re-enable the cut, copy & paste commands
        Call ToggleCutCopyAndPaste(True) 
    End Sub 
     
    Private Sub Workbook_Open() 
         'Force the current selection to be selected, triggering the appropriate
         'state of the cut, copy & paste commands
        Selection.Select 
    End Sub 
     
    Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range) 
         'Toggle the cut, copy & paste commands on selected ranges
         
        Select Case Sh.Name 
        Case Is = "Sheet1" 
             'Disable cut, copy & paste for Sheet1, Column A
            If Not Intersect(Target, Target.Parent.Columns(1)) Is Nothing Then 
                Call ToggleCutCopyAndPaste(False) 
            Else 
                Call ToggleCutCopyAndPaste(True) 
            End If 
             
        Case Is = "Sheet2" 
             'Disable cut, copy & paste for Sheet2, Range G1:H5
            If Not Intersect(Target, Target.Parent.Range("G1:H5")) Is Nothing Then 
                Call ToggleCutCopyAndPaste(False) 
            Else 
                Call ToggleCutCopyAndPaste(True) 
            End If 
             
        Case Else 
             'Re-enable cut copy and paste commands as this is not a restricted sheet
            Call ToggleCutCopyAndPaste(True) 
        End Select 
    End Sub
    Last edited by jeffreybrown; 11-23-2012 at 01:00 AM. Reason: Please use code tags...Thanks.

  2. #2
    Forum Contributor
    Join Date
    09-29-2011
    Location
    Kolkata, India
    MS-Off Ver
    Excel 2003/2007
    Posts
    182

    Re: Disable Cut/Copy

    Hi,

    Test your code again by replacing (or removing) the bold part below..

    If Not Intersect(Target, Target.Parent.Columns(1)) Is Nothing Then

    I am not able to check your code as there is no ToggleCutCopyAndPaste() function/procedure in your code. If possible then please add the same.

    Regards
    taps
    Last edited by taps; 11-23-2012 at 10:03 AM.

  3. #3
    Registered User
    Join Date
    04-30-2012
    Location
    Ireland
    MS-Off Ver
    Excel 2010
    Posts
    72

    Re: Disable Cut/Copy

    Thanks Il Let you known how I get on

  4. #4
    Registered User
    Join Date
    04-30-2012
    Location
    Ireland
    MS-Off Ver
    Excel 2010
    Posts
    72

    Re: Disable Cut/Copy

    Hey,
    This seems to have disabled Cut/Copy/Paste in all excel docs o my computer? I have disabled a Macro's but it still has them disabled

  5. #5
    Forum Contributor
    Join Date
    09-29-2011
    Location
    Kolkata, India
    MS-Off Ver
    Excel 2003/2007
    Posts
    182

    Re: Disable Cut/Copy

    Hi,

    Could you please provide the codes for ToggleCutCopyAndPaste() .
    May be we can get some solutions there.

    taps

  6. #6
    Registered User
    Join Date
    04-30-2012
    Location
    Ireland
    MS-Off Ver
    Excel 2010
    Posts
    72

    Re: Disable Cut/Copy

    I didnt change the above Macro as I didnt get around to it. I tested the above macro which disabled the Cut/Copy/Paste Feature then I created this post. It was only later when opening a seperate document that I noticed its disabled the feature across all excel Docs on my user log in any way.
    Thanks For Your Help
    Last edited by gmcgrane; 11-30-2012 at 05:47 AM. Reason: Forgot to Say Thanks :)

+ 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