Foros del Web » Soporte técnico » Ofimática »

Mejorar código checklist macro vba

Estas en el tema de Mejorar código checklist macro vba en el foro de Ofimática en Foros del Web. Tengo un código que me gustaría ampliar. permite crear hojas de chequeo. La inicial tiene un número de topics y de itemes por topic Me ...
  #1 (permalink)  
Antiguo 19/01/2013, 09:01
Avatar de Pasote  
Fecha de Ingreso: mayo-2006
Ubicación: España - Islas Canarias
Mensajes: 389
Antigüedad: 17 años, 11 meses
Puntos: 3
Mejorar código checklist macro vba

Tengo un código que me gustaría ampliar.
permite crear hojas de chequeo.
La inicial tiene un número de topics y de itemes por topic
Me gustaría que se pudieran aumentar el número de topic's, y que el número de item's por topic pudiera ser distinto.

El código inicial es :

Código:
Option Explicit

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
' Manage double clicking on the worksheet (used for changing the status of a check item or an entire topic)
Dim blnIsTopic As Boolean

    On Error Resume Next
    
    ' User double clicked outside the checklist area - > exit sub
    If Application.Intersect(ActiveCell, Range("myCheckList")) = False Then Exit Sub

    ' Set boolean variable: true, if user double clicked on a topic (header)
    blnIsTopic = (InStr(ActiveCell.Offset(0, -(ActiveCell.Column - Range("myCheckList").Column)), C_SEPARATOR) = 0) And _
                 (ActiveCell.Offset(0, -(ActiveCell.Column - Range("myCheckList").Column)).Value <> "")
              
    If ActiveCell.Column = Range("myCheckList").Column + Range("myCheckList").Columns.Count - 1 Then
    ' User double clicked on a cell in the status column
        
        If ActiveCell.Value = C_DONE Then
        ' If status = done: status will be set to open
            ActiveCell.Value = C_OPEN
        ElseIf ActiveCell.Value = C_OPEN Or ActiveCell.Value = C_MIXED Then
        ' If status = open or mixed (topics only): status will be set to done
            ActiveCell.Value = C_DONE
        End If
        
        If blnIsTopic Then
            Call ChangeTopicStatus
        Else
            Call AutomaticSetTopicStatus
        End If
    
    ElseIf blnIsTopic Then
    ' User double clicked in a topic row and not on the status column -> expand or collapse the items of this topic
        Call ExpandCollapseItems
    End If

End Sub
Gracias

Etiquetas: macro, mejorar, vba
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 11:03.