Namig: drugi jeziki so prevedeni v Google. Lahko obiščete English različico te povezave.
Vpiši se
x
or
x
x
Registracija
x

or

Kako onemogočiti funkcije rezanja, kopiranja in prilepka v Excelu?

Predvidevam, da imate delovni zvezek s pomembnimi podatki, ki jih morate zaščititi pred rezanjem, kopiranjem in prilepili. Kako doseči to? V tem članku je opisana metoda VBA, ki hkrati onemogoča funkcije rezanja, kopiranja in prilepka v delovnem zvezku Excel.

Onemogoči funkcije rezanja, kopiranja in prilepka s kodo VBA


puščica modra desno mehurčekOnemogoči funkcije rezanja, kopiranja in prilepka s kodo VBA


Prosimo, naredite, da onemogočite funkcije rezanja, kopiranja in prilepka v delovnem zvezku Excel.

1. V delovnem zvezku morate onemogočiti funkcije rezanja, kopiranja in prilepka, pritisnite druga + F11 tipke hkrati odpreti Microsoft Visual Basic za aplikacije okno.

2. V Ljubljani Microsoft Visual Basic za aplikacije okno, dvakrat kliknite ThisWorkbook na levi strani Projekt podokno in nato kopirajte in prilepite spodnjo kodo VBA v ThisWorkbook (koda) okno. Prikaz slike:

VBA koda: onemogočite funkcije za zmanjšanje, kopiranje in lepljenje hkrati v Excelu

Private Sub Workbook_Activate()
Application.CutCopyMode = False
Application.OnKey "^c", ""
Application.CellDragAndDrop = False
End Sub

Private Sub Workbook_Deactivate()
Application.CellDragAndDrop = True
Application.OnKey "^c"
Application.CutCopyMode = False
End Sub

Private Sub Workbook_WindowActivate(ByVal Wn As Window)
Application.CutCopyMode = False
Application.OnKey "^c", ""
Application.CellDragAndDrop = False
End Sub

Private Sub Workbook_WindowDeactivate(ByVal Wn As Window)
Application.CellDragAndDrop = True
Application.OnKey "^c"
Application.CutCopyMode = False
End Sub

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Application.CutCopyMode = False
End Sub

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Application.OnKey "^c", ""
Application.CellDragAndDrop = False
Application.CutCopyMode = False
End Sub

Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
Application.CutCopyMode = False
End Sub

3. Potem pritisnite druga + Q tipke za izhod iz Microsoft Visual Basic za aplikacije okno.

Zdaj ne morete rezati ali kopirati podatkov iz te delovne knjige, medtem ko podatki, ki ste jih kopirali iz drugih listov, ali delovnih zvezkov ni mogoče prilepiti v ta delovni zvezek.

Opombe: Funkcija povleci in spusti je onemogočena tudi po zagonu zgornje kode VBA.


puščica modra desno mehurčekSorodni članki:


Priporočena orodja za produktivnost za Excel

zavihek kte 201905

Kutools za Excel vam pomaga, da vedno končate delo pred časom in izstopite iz množice

  • Več kot zmogljive napredne funkcije 300, zasnovane za 1500 delovne scenarije, ki povečujejo produktivnost z 70%, vam dajejo več časa za skrb za družino in uživanje v življenju.
  • Ne potrebujete več pomnilniških formul in VBA kod, od zdaj naprej pa dajate svojim možganom počitek.
  • Postanite strokovnjak za Excel v minutah 3, zapletene in ponavljajoče se operacije lahko opravite v nekaj sekundah,
  • Vsak dan zmanjšajte število operacij tipkovnice in miške, zdaj se poslovite od poklicnih bolezni.
  • 110,000 visoko učinkovite ljudi in 300 + svetovno priznanih podjetij izbiro.
  • Brezplačna preizkusna različica 60 dneva. 60-dnevno jamstvo vračila denarja. 2 let brezplačne nadgradnje in podpore.

Prinaša kartično brskanje in urejanje za Microsoft Office, veliko močnejši od zavihkov brskalnika

  • Office Tab je namenjen za Word, Excel, PowerPoint in druge Office aplikacije: Založnik, Dostop, Visio in Projekt.
  • Odprite in ustvarite več dokumentov v novih zavihkih istega okna in ne v novih oknih.
  • Z 50% poveča vašo produktivnost in vsak dan zmanjša na stotine klikov z miško!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    RN PK · 2 months ago
    Thanks it works perfect ....can it be applied on a range only somehow?
  • To post as a guest, your comment is unpublished.
    Sam · 4 months ago
    It really works well, thanks a lot.
  • To post as a guest, your comment is unpublished.
    Vic · 4 months ago
    Hi, the code works well thanks.
    However, the read only option was enabled. (if you don't want to modify). If I set ..File, save as, tools, general options, read only recommended.. then the code does not work.

    Thanks in advance.
  • To post as a guest, your comment is unpublished.
    Al Hammad · 8 months ago
    Thank your for your direction.I am Trying in office 2013 ,but nothing changed.
  • To post as a guest, your comment is unpublished.
    Garak0410 · 10 months ago
    Was super glad to find this post but I need a little help in limiting this to a single worksheet in a multi-worksheet Workbook. And need to know how to execute this without user intervention...we need this ASAP on a workbook to help prevent errors.
    • To post as a guest, your comment is unpublished.
      crystal · 9 months ago
      Good day,
      The following VBA code can help you to solve the problem. And don't forget to replace "Sheet2" in the code with your sheet name.

      Public mJWSName As String

      Private Sub Workbook_Open()
      mJWSName = "Sheet2"
      End Sub

      Private Sub Workbook_Activate()
      If ActiveSheet.Name = mJWSName Then
      Application.CutCopyMode = False
      Application.OnKey "^c", ""
      Application.CellDragAndDrop = False
      End If
      End Sub

      Private Sub Workbook_Deactivate()
      Application.OnKey "^c", ""
      Application.CellDragAndDrop = True
      Application.CutCopyMode = False
      End Sub


      Private Sub Workbook_WindowActivate(ByVal Wn As Window)
      If ActiveSheet.Name = mJWSName Then
      Application.CutCopyMode = False
      Application.OnKey "^c", ""
      Application.CellDragAndDrop = False
      End If
      End Sub

      Private Sub Workbook_WindowDeactivate(ByVal Wn As Window)
      Application.OnKey "^c"
      Application.CellDragAndDrop = True
      Application.CutCopyMode = False
      End Sub

      Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
      On Error Resume Next
      If Sh.Name = mJWSName Then
      Application.CutCopyMode = False
      End If
      End Sub

      Private Sub Workbook_SheetActivate(ByVal Sh As Object)
      On Error Resume Next
      If Sh.Name = mJWSName Then
      Application.OnKey "^c", ""
      Application.CellDragAndDrop = False
      Application.CutCopyMode = False
      End If
      End Sub

      Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
      Application.OnKey "^c"
      Application.CellDragAndDrop = True
      Application.CutCopyMode = False
      End Sub
      • To post as a guest, your comment is unpublished.
        Garak0410 · 9 months ago
        One last question - Where does this code go and how does it get executed? The project this needs to work with attaches an XLA file to the Excel sheet that contains much of the code. Didn't know if this needs to go into a module or the code behind this sheet. Thanks...