PROBLEMAS PARA PROTEGER DATOS

emiaj61

New Member
Joined
Dec 11, 2006
Messages
17
TENGO DATOS AGRUPADOS EN 10 COLUMNAS, COLUMNA A PLACAS DE TRAILER, COLUMNA B LINEA CAMIONERA, COLUMNA C NOMBRE DEL OPERADOR, ETC. MEDIANTE EL USO DE DISTINTAS FORMULAS APLICADAS A LOS DATOS DE CADA FILA, EN LA ULTIMA CELDA DE CADA FILA SE OBTIENE UN RESULTADO DE "OK" o "RECHAZADO".
EXISTE ALGUNA MANERA DE QUE AL OBTENER UN "OK" LOS DATOS DE ESA FILA Y SOLO DE ESA QUEDEN PROTEGIDOS, DA MANERA QUE NO SE PUEDAN CAMBIAR.

POR SU ATENCION GRACIAS
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Una posibilidad sería:
1)Seleccionar el area de ingreso de Datos, FORMATO>>cCELDAS>>PROTEGER y destildar "BLOQUEADO"
2) Seleccionar la columna 11ma, la del OK-RECHAZADO, entonces DEFINIR>>INSERTAR>>NOMBRE >>"Verificación"
3) En el módulo de la Hoja: este procedimiento de evento:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Me.Range("Verificación")) Is Nothing Then Exit Sub
If UCase(Target.Value) <> "OK" Then Exit Sub

Me.Unprotect "Password"
Me.Range(Target.Offset(0, -10), Target.Offset(0, -1)).Locked = True

Me.Protect "Password"


End Sub

GALILEOGALI
 
Upvote 0
Gali,

Disculpe, pero eso solamente funciona cuando el usuario edita las celdas con OK/Rechazado y realmente queremos trabar las celdas cuando las celdas dicen OK, entonces tenemos que escanear las celdas que impactan la fórmula. Entonces algo así serviría mejor...
Code:
Private Sub Worksheet_Change(ByVal Target As Range)

    '// +-----------------------------------------------+
    '// | ¡Limitación importante!                       |
    '// |  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯                        |
    '// | Esta solución usa la propiedad DEPENDENTS     |
    '// | que solamente devuelve celdas vinculadas por  |
    '// | fórmulas en la misma hoja.  Si hay celdas     |
    '// | que impactan OK/Rechazado ubicadas en otras   |
    '// | hojas este código no rende.                   |
    '// +-----------------------------------------------+

    '// defina el contraseña y el nombre del rango
    '// con OK/Rechazado aqui...
    Const c_strPassword As String = "Contraseña"
    Const c_strRangetoVerify As String = "ParaVerificar"

    Dim rngCell As Range, rngISect As Range
    
    Me.Unprotect c_strPassword
    On Error GoTo Salida
    Set rngISect = Intersect(Target.Dependents, Range(c_strRangetoVerify))
    For Each rngCell In rngISect.Cells
        If rngCell = "OK" Then
            rngCell.Locked = True
            rngCell.Precedents.Locked = True
        End If
    Next rngCell
    
Salida:
'""""""
    Me.Protect c_strPassword
End Sub

emiaj61,

Bienvenido a MrExcel. Favor note que esta solución está basado en el sendero que tomó Gali. Entonces siempre hay que seguir los pasos 1 y 2 de él. Solamente note que use un nombre de rango un poco diferente en mi ejemplo y es necesario que haya acuerdo entre el nombre que usted decide asignar al rango y el constante definido en la cabeza de la rutina.

<hr />Esta programación tiene que estar ubicado en la hoja. La manera más fácil para llegar al modulo de la hoja es hacer un cliq-derecho en la linguita (etiqueta) de la hoja y seleccionar «view code» del menú popup.
 
Upvote 0
GREG: Correcto!!!
(eso me ocurrió, por leer muy apresuradamente, el enunciado de la consulta. Ahora que lo releo, me di cuenta de mi error de interpretación.)
Excuse me.

GALI
 
Upvote 0

Forum statistics

Threads
1,213,495
Messages
6,113,992
Members
448,538
Latest member
alex78

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top