Tengo un dilema como se pueden ejecutar tres macros en una sola hoja y si es posible anexo detalles de los codigos
Private Sub Worksheet_Change(ByVal Target As Range) On Error Resume Next If Target.Column <> 1 Then Exit Sub Select Case UCase(Target.Text) Case "SEP" MsgBox "Solo se aceptan profesores de base" Case "STEN 41" MsgBox "Dato incorrecto" 'Aqui puedes añadir tantos casos como quieras End Select
End Sub
Dim X As Variant Private Sub Worksheet_Change(ByVal Target As Range) On Error GoTo neo If Intersect(Target, Range("E7:F454")) Is Nothing Or Target.Value = "OTROS" Then Exit Sub If Intersect(Target, Range("E7:F454")) Is Nothing Or Target.Value = "PROCESO" Then Exit Sub If Intersect(Target, Range("E7:F454")) Is Nothing Or Target.Value = "DELEGAR" Then Exit Sub If Target.Value = "" And X = "DELEGAR" Then Target.Offset(, 13).ClearContents Else Target.Offset(, 13) = Format(Now, "hh:mm:ss") End If neo: Exit Sub End Sub Private Sub Worksheet_SelectionChange(ByVal Target As Range) X = Target.Value End Sub
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) On Error GoTo etiqueta If Target.Value = "OTROS" Then Range(Target.Address, "W" & Target.Row).Interior.Color = RGB(255, 0, 0) End If If Target.Value = "ANALISIS INTEGRAL" Then Range(Target.Address, "W" & Target.Row).Interior.Color = RGB(255, 255, 0) End If If Target.Value = "RECHAZADA" Then Range(Target.Address, "W" & Target.Row).Interior.Color = RGB(128, 128, 128) End If etiqueta: Exit Sub End Sub
Por favor de su valiosa ayuda
Les agradezco de antemano.
Featured Replies
Archivado
Este tema está ahora archivado y está cerrado a más respuestas.
Buen dia.
Tengo un dilema como se pueden ejecutar tres macros en una sola hoja y si es posible anexo detalles de los codigos
Private Sub Worksheet_Change(ByVal Target As Range) On Error Resume Next If Target.Column <> 1 Then Exit Sub Select Case UCase(Target.Text) Case "SEP" MsgBox "Solo se aceptan profesores de base" Case "STEN 41" MsgBox "Dato incorrecto" 'Aqui puedes añadir tantos casos como quieras End Select
End Sub
Dim X As Variant Private Sub Worksheet_Change(ByVal Target As Range) On Error GoTo neo If Intersect(Target, Range("E7:F454")) Is Nothing Or Target.Value = "OTROS" Then Exit Sub If Intersect(Target, Range("E7:F454")) Is Nothing Or Target.Value = "PROCESO" Then Exit Sub If Intersect(Target, Range("E7:F454")) Is Nothing Or Target.Value = "DELEGAR" Then Exit Sub If Target.Value = "" And X = "DELEGAR" Then Target.Offset(, 13).ClearContents Else Target.Offset(, 13) = Format(Now, "hh:mm:ss") End If neo: Exit Sub End Sub Private Sub Worksheet_SelectionChange(ByVal Target As Range) X = Target.Value End Sub
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) On Error GoTo etiqueta If Target.Value = "OTROS" Then Range(Target.Address, "W" & Target.Row).Interior.Color = RGB(255, 0, 0) End If If Target.Value = "ANALISIS INTEGRAL" Then Range(Target.Address, "W" & Target.Row).Interior.Color = RGB(255, 255, 0) End If If Target.Value = "RECHAZADA" Then Range(Target.Address, "W" & Target.Row).Interior.Color = RGB(128, 128, 128) End If etiqueta: Exit Sub End Sub
Por favor de su valiosa ayuda
Les agradezco de antemano.