Results 1 to 20 of 26

Thread: Disable Cut, Copy, Paste Macro for One Column

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #13

    Help

    Please, the macro works perfect, but I need to activate it in one sheet for 2 columns, like this:

    Sub ChkSelection(ByVal Sh As Object)
        Select Case Sh.Name
       Case "CLIENTE PN"
          ToggleCutCopyAndPaste Intersect(Selection, Sh.Columns(15)) Is Nothing
       Case "CLIENTE PJ"
          ToggleCutCopyAndPaste Intersect(Selection, Sh.Columns(13)) Is Nothing
       Case "CONCESIONARIOS"
          ToggleCutCopyAndPaste Intersect(Selection, Sh.Columns(10)) Is Nothing
       Case "PROVEEDORES"
          ToggleCutCopyAndPaste Intersect(Selection, Sh.Columns(13)) Is Nothing
       Case "PROVEEDORES"
          ToggleCutCopyAndPaste Intersect(Selection, Sh.Columns(17)) Is Nothing
       Case "EMPLEADOS"
          ToggleCutCopyAndPaste Intersect(Selection, Sh.Columns(16)) Is Nothing
       Case Else
          ToggleCutCopyAndPaste True
        End Select
    End Sub
    In sheet "PROVEEDORES" only detects the 13th column, but not the 17th column, the rest of the code works, with one exception:

    In Excel 2013 the macro

    Sub CutCopyPasteDisabled()
        MsgBox ("Lo sentimos, la fecha no puede ser copiada de otra celda")
    End Sub
    Only runs on a standard module, not in the Thisworkbook module
    Thanks
    Last edited by Aussiebear; 04-08-2023 at 04:09 AM. Reason: Adjusted the code tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •