Consejo: Otros idiomas son traducidos por Google. Puedes visitar el English versión de este enlace.
Iniciar sesión
x
or
x
x
Suscríbete
x

or

¿Cómo deshabilitar cortar, copiar y pegar funciones en Excel?

Supongamos que tiene un libro de trabajo con datos importantes que necesita proteger para evitar que se corte, copie y pegue. ¿Cómo lograrlo? Este artículo proporciona un método VBA para que deshabilite las funciones cortar, copiar y pegar al mismo tiempo en un libro de Excel.

Desactivar cortar, copiar y pegar funciones con código VBA

Ficha Office Habilite la edición y navegación con pestañas en Office y haga su trabajo mucho más fácil ...
Kutools for Excel trae las características avanzadas de 300 a Excel y aumenta su productividad en 80%
  • Super Formula Bar (edite fácilmente varias líneas de texto y fórmula); Diseño de lectura (lee y edita fácilmente un gran número de celdas); Pegar en rango filtrado...
  • Combinar celdas / filas / columnas y mantener datos; Contenido de celdas divididas; Combinar filas duplicadas y suma / promedio... Prevenir células duplicadas; Comparar rangos...
  • Seleccione Duplicado o Único Filas; Seleccionar filas en blanco (todas las celdas están vacías); Super Find y Fuzzy Find en muchos libros de trabajo; Selección aleatoria ...
  • Copia exacta Celdas múltiples sin cambiar la referencia de fórmula; Crear referencias automáticamente a múltiples hojas; Insertar viñetas, Casillas de verificación y más ...
  • Fórmulas favoritas e insertadas rápidamente, Gamas, cuadros y cuadros; Cifrar celdas con contraseña Crear una lista de correo y enviar correos electrónicos ...
  • Extracto del texto, Agregar texto, Eliminar por posición, Eliminar espacio; Crear e imprimir subtotales de paginación; Convertir entre contenido de celdas y comentarios...
  • Súper filtro (guardar y aplicar esquemas de filtro a otras hojas); Clasificación avanzada por mes / semana / día, frecuencia y más; Filtro especial por negrita, cursiva ...
  • Combinar libros de trabajo y hojas de trabajo; Combinar tablas basadas en columnas clave; Dividir datos en varias hojas; Conversión por lotes xls, xlsx y PDF...
  • Kutools funciona con Office 2007-2019 y 365. Es compatible con todos los idiomas y es muy fácil de instalar o implementar. Funciones completas de prueba gratuita de 60-day.

flecha azul burbuja derechaDesactivar cortar, copiar y pegar funciones con código VBA


Haga lo siguiente para desactivar las funciones de cortar, copiar y pegar en un libro de Excel.

1. En el libro de trabajo necesita desactivar las funciones de cortar, copiar y pegar, presione otro + F11 teclas simultáneamente para abrir el Microsoft Visual Basic para aplicaciones ventana.

2. En el Microsoft Visual Basic para aplicaciones ventana, por favor haga doble clic ThisWorkbook En la izquierda Proyecto panel, y luego copiar y pegar el siguiente código VBA en el ThisWorkbook (Código) ventana. Ver captura de pantalla:

Código de VBA: deshabilite las funciones de cortar, copiar y pegar al mismo tiempo en Excel

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. Luego presione el otro + Q teclas para salir del Microsoft Visual Basic para aplicaciones ventana.

Ahora no puede cortar ni copiar datos de este libro de trabajo, mientras tanto, los datos que ha copiado de otras hojas o libros de trabajo no se pueden pegar en este libro de trabajo.

Nota: La función de arrastrar y soltar también se desactiva después de ejecutar el código VBA anterior.


flecha azul burbuja derechaArtículos relacionados:


Kutools for Excel: la mejor herramienta de productividad de Office aumenta su productividad en un 80%

  • Super Formula Bar (edite fácilmente varias líneas de texto y fórmula); Diseño de lectura (lee y edita fácilmente un gran número de celdas); Pegar en rango filtrado...
  • Combinar celdas / filas / columnas y mantener datos; Contenido de celdas divididas; Combinar filas duplicadas y suma / promedio... Prevenir células duplicadas; Comparar rangos...
  • Seleccione Duplicado o Único Filas; Seleccionar filas en blanco (todas las celdas están vacías); Super Find y Fuzzy Find en muchos libros de trabajo; Selección aleatoria ...
  • Copia exacta Celdas múltiples sin cambiar la referencia de fórmula; Crear referencias automáticamente a múltiples hojas; Insertar viñetas, Casillas de verificación y más ...
  • Fórmulas favoritas e insertadas rápidamente, Gamas, cuadros y cuadros; Cifrar celdas con contraseña Crear una lista de correo y enviar correos electrónicos ...
  • Extracto del texto, Agregar texto, Eliminar por posición, Eliminar espacio; Crear e imprimir subtotales de paginación; Convertir entre contenido de celdas y comentarios...
  • Súper filtro (guardar y aplicar esquemas de filtro a otras hojas); Clasificación avanzada por mes / semana / día, frecuencia y más; Filtro especial por negrita, cursiva ...
  • Combinar libros de trabajo y hojas de trabajo; Combinar tablas basadas en columnas clave; Dividir datos en varias hojas; Conversión por lotes xls, xlsx y PDF...
  • Funciona con Office 2007-2019 y 365, y es compatible con todos los idiomas. Es fácil de implementar en su empresa. Funciones completas de prueba gratuita de 60-day.
pestaña kte 201905

Office Tab lleva la interfaz con pestañas a Office y hace que su trabajo sea mucho más fácil

  • Habilitar la edición y lectura con pestañas en Word, Excel, PowerPoint, Editor, Acceso, Visio y Proyecto.
  • Abra y cree varios documentos en nuevas pestañas de la misma ventana, en lugar de en nuevas ventanas.
  • ¡Aumenta tu productividad en un 50% y reduce cientos de clics de ratón por ti todos los días!
fondo officetab
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.
    RAHUL MODI · 1 months ago
    THANKS SIR
  • To post as a guest, your comment is unpublished.
    RN PK · 4 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 · 6 months ago
    It really works well, thanks a lot.
  • To post as a guest, your comment is unpublished.
    Vic · 7 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 · 10 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 · 1 years 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 · 1 years 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 · 1 years 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...
  • To post as a guest, your comment is unpublished.
    Linda · 1 years ago
    Hi

    I´m a beginner of VBA codes and this code solved 99% of my problems.

    Is it possible to lock the hole sheet (as this code dose) but still have one cell unlocked?
    (Clarify, I would like to allow copy past in info in only one cell in the hole sheet).

    Best regards
    L
    • To post as a guest, your comment is unpublished.
      crystal · 1 years ago
      Hello Linda,
      You can solve the problem without using VBA code.
      Right click the cell and select Format Cells from the context menu, uncheck the Locked box under the Protection tab in the dialog. And then protect the worksheet with password.
  • To post as a guest, your comment is unpublished.
    Carmelo · 1 years ago
    Hi,
    Is it possible to disable "CUT" only? but I could still use the Copy and Paste?
    • To post as a guest, your comment is unpublished.
      crystal · 1 years ago
      Hi Carmelo,
      Please copy and paste the below code into the Workbook code window in your workbook and then save it as an Excel Macro-enabled workbook. Then the "Cut" function will be disabled.

      Option Explicit
      Private WithEvents Cmbrs As CommandBars

      Private Sub Workbook_Open()
      Set Cmbrs = Application.CommandBars
      End Sub

      Private Sub Workbook_Activate()
      If Application.CutCopyMode = 2 Then
      Application.CutCopyMode = 0
      End If
      End Sub

      Private Sub Cmbrs_OnUpdate()
      If Me Is ActiveWorkbook Then
      If Application.CutCopyMode = 2 Then
      Application.CutCopyMode = 0
      MsgBox "Cut Operations disabled"
      End If
      End If
      End Sub
      • To post as a guest, your comment is unpublished.
        ERCA · 1 years ago
        I tried just like you said but nothing happends. A want exactly the same, Only the
        "Cut" function disabled. I need to disable the "cut" option from Rightclick buton option and from the toolbar.
        It is posible crystal??
        • To post as a guest, your comment is unpublished.
          crystal · 1 years ago
          Good day,
          The code works well in my case. May I know your Office version?
  • To post as a guest, your comment is unpublished.
    Midas Pvt Ltd · 1 years ago
    Dear,

    i want to disable cut, copy, paste in excel 2007 sheet
    can you share code for this
    • To post as a guest, your comment is unpublished.
      crystal · 1 years ago
      Good Day,
      Thank you for your comment. I am trying to figure out the solution for Excel 2007. Please wait patiently.
  • To post as a guest, your comment is unpublished.
    Sky · 1 years ago
    How to enable the cut, copy and paste function back? Please advice!
    • To post as a guest, your comment is unpublished.
      crystal · 1 years ago
      Dear Sky
      Please run the below VBA1 (place the code in the ThisWorkbook module) to disable the cut, copy and paste function in your workbook.

      VBA1:
      Sub DelCopy()
      With Application
      .OnKey "^x", ""
      .OnKey "^c", ""
      .CommandBars("Cell").Controls(1).Enabled = False
      .CommandBars("Cell").Controls(2).Enabled = False
      End With
      End Sub

      And the run the VBA2 to enable all these functions back to your workbook.

      VBA2:
      Sub RecoverCopy()
      With Application
      .OnKey "^x"
      .OnKey "^c"
      .CommandBars("Cell").Controls(1).Enabled = True
      .CommandBars("Cell").Controls(2).Enabled = True
      End With
      End Sub
      • To post as a guest, your comment is unpublished.
        mags · 1 years ago
        This doesn't seem to have worked for me - should I delete the original VBA code and then paste the above in to enable the Cut, copy and paste function again?
        • To post as a guest, your comment is unpublished.
          crystal · 1 years ago
          Good Day,
          The VBA1in above comment is the replacement of the original code.
  • To post as a guest, your comment is unpublished.
    Martin · 2 years ago
    Thanks a Lot.Its working in entire worbook. Can we do the coding only for 1 sheet.Please help .
  • To post as a guest, your comment is unpublished.
    Martin · 2 years ago
    Thanks u Sir its working .But in Entire workbook. If i need this Code only i particular sheet.Is it Possible ??
    • To post as a guest, your comment is unpublished.
      sa · 1 years ago
      have you found an answer?
  • To post as a guest, your comment is unpublished.
    rafhtaher · 2 years ago
    i do as above but the function of cut copy and past disabled in any excel file i open .why?
    • To post as a guest, your comment is unpublished.
      Stuart Davis · 2 months ago
      Hi, I used this to hide "Cut" from users and it works great unless you have a Table, the "Cut" miraculously re-appears when you select a cell in the Table, exactly what i'm trying to avoid. any ideas? thanks!