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. #20
    SamT:
    Ok, this is what I'm getting know:
    All variables declared (option Explicit at the beggining)

    Solved problem in other workbooks with your suggestion:

    Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    Dim ShtName As String
        ShtName = Sh.Name
        Dim Col As Long
        Col = Target.Column
    If ShtName = "CLIENTE PN" And Col = 15 Then Application.Run ("fecha_hoy")
    If ShtName = "CLIENTE PJ" And Col = 13 Then Application.Run ("fecha_hoy")
    If ShtName = "CONCESIONARIOS" And Col = 10 Then Application.Run ("fecha_hoy")
    If ShtName = "PROVEEDORES" And (Col = 13 Or Col = 17) Then Application.Run ("fecha_hoy")
    If ShtName = "EMPLEADOS" And (Col = 12 Or Col = 16) Then Application.Run ("fecha_hoy")
    End Sub
    Solved problem (all cells controled) in sheets "PROVEEDORES" and "EMPLEADOS" with:

    Case "PROVEEDORES"
       If Not Intersect(Selection, Sh.Columns(13)) Is Nothing Then
          ToggleCutCopyAndPaste Intersect(Selection, Sh.Columns(13)) Is Nothing
          ElseIf Not Intersect(Selection, Sh.Columns(17)) Is Nothing Then
          ToggleCutCopyAndPaste Intersect(Selection, Sh.Columns(17)) Is Nothing
          Else: ToggleCutCopyAndPaste True
       End If
       Case "EMPLEADOS"
          If Not Intersect(Selection, Sh.Columns(12)) Is Nothing Then
             ToggleCutCopyAndPaste Intersect(Selection, Sh.Columns(12)) Is Nothing
             ElseIf Not Intersect(Selection, Sh.Columns(16)) Is Nothing Then
             ToggleCutCopyAndPaste Intersect(Selection, Sh.Columns(16)) Is Nothing
             Else: ToggleCutCopyAndPaste True
       End If
    Getting error 1004 (error in method select of clase range) with this when closing the workbook:

    Private Sub Workbook_Activate()
        ActiveSheet.Range("A6").Select
        Application.CellDragAndDrop = False
    End Sub
    Last edited by Aussiebear; 04-08-2023 at 04:20 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
  •