Moderatori: Anthony47, Flash30005
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("e2:e500")) Is Nothing Then
If Target.Value = "SI" Then
Worksheets("Foglio1").Unprotect
Worksheets("Foglio1").Cells.Locked = True
Worksheets("Foglio1").Range("e" & Target.Row + 4 & ":" & "i" & Target.Row + 4).Locked = False
End If
End If
Worksheets("Foglio1").Protect
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Dim cel As Range
Set rng = Worksheets("Foglio2").Range("e2:e500")
Worksheets("Foglio1").Unprotect
Worksheets("Foglio1").Cells.Locked = True
If Not Intersect(Target, Range("e2:e500")) Is Nothing Then
For Each cel In rng
If cel.Value = "SI" Then
Worksheets("Foglio1").Range("e" & cel.Row + 4 & ":" & "i" & cel.Row + 4).Locked = False
End If
Next cel
End If
Worksheets("Foglio1").Protect
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Integer
Dim rng As Range
Dim cel As Range
Set rng = Worksheets("Foglio2").Range("e2:e500")
For i = 1 To ThisWorkbook.Sheets.Count - 1
Worksheets("Foglio" & i).Unprotect
Worksheets("Foglio" & i).Cells.Locked = True
Next i
If Not Intersect(Target, Range("e2:e500")) Is Nothing Then
For Each cel In rng
If cel.Value = "SI" Then
For i = 1 To ThisWorkbook.Sheets.Count - 1
Worksheets("Foglio" & i).Range("e" & cel.Row + 4 & ":" & "i" & cel.Row + 4).Locked = False
Next
End If
Next cel
End If
For i = 1 To ThisWorkbook.Sheets.Count - 1
Worksheets("Foglio" & i).Protect
Next i
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Integer
Dim rng As Range
Dim cel As Range
Set rng = Worksheets("dipendenti").Range("e2:F500")
Application.ScreenUpdating = False
For i = 1 To ThisWorkbook.Sheets.Count - 1
Sheets(i).Unprotect
Sheets(i).Cells.Locked = True
Next i
If Not Intersect(Target, Range("e2:f500")) Is Nothing Then
Select Case Target.Column
Case Is = 5
For Each cel In rng
If cel.Value = "SI" Then
For i = 1 To 6
Sheets(i).Range("e" & cel.Row + 4).Locked = False
Sheets(i).Range("G" & cel.Row + 4).Locked = False
Next
End If
Next cel
Case Is = 6
For Each cel In rng
If cel.Value = "SI" Then
For i = 7 To 12
Sheets(i).Range("e" & cel.Row + 4).Locked = False
Sheets(i).Range("G" & cel.Row + 4).Locked = False
Next i
End If
Next cel
End Select
End If
For i = 1 To ThisWorkbook.Sheets.Count - 1
Sheets(i).Protect
Next i
Application.ScreenUpdating = True
End Sub
alfrimpa ha scritto:Richiedere un lavoro e poi "sparire" senza dare il minimo riscontro non mi sembra corretto.
Torna a Applicazioni Office Windows
Inserimento parziale valore cella in MessageBox Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 6 |
Aggiornare cella con somma quando aggiungo nuova colonna Autore: marcopont |
Forum: Applicazioni Office Windows Risposte: 1 |
Eliminare righe diverse dalla prima data del mese Autore: dipdip |
Forum: Applicazioni Office Windows Risposte: 4 |
Visitano il forum: Nessuno e 24 ospiti