Ciao sapete se si può Bloccare automaticamente il valore scritto in una cella di excel ?esempio:
io scrivo in una cella "11:40",vorrei che nel momemto in cui do invio ,immediatamente la cella non si possa modificare.
Grazie
Moderatori: Anthony47, Flash30005
Public Preced As Boolean
Private Sub Worksheet_Change(ByVal Target As Range)
CheckArea = "D1:D40" '<<< L' area da bloccare
If Intersect(Target, Range(CheckArea)) Is Nothing Then Exit Sub
Application.EnableEvents = False
If Preced Then
Application.Undo
MsgBox ("Vietato modificare la cella " & Target.Address)
End If
Fines:
Application.EnableEvents = True
'Target.Offset(1, 0).Select ' Opzionale
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
On Error Resume Next
If IsError(Target.Value) Then
Preced = False
Else
If Target.Value <> 0 Then Preced = True Else Preced = False
End If
End Sub
Public Preced As Boolean, ACelAd As String
Private Sub Worksheet_Change(ByVal Target As Range)
CheckArea = "D1:D40" '<< L' area da bloccare
If Intersect(Target, Range(CheckArea)) Is Nothing Then Exit Sub
'ACelAd = ActiveCell.Range("A1").Address
If Preced Then
Application.EnableEvents = False
Application.Undo: ACelAd = ActiveCell.Range("A1").Address
MsgBox ("Vietato modificare la cella " & Target.Address)
Application.EnableEvents = True
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If ActiveCell.Address = ACelAd Then Exit Sub
On Error Resume Next
If IsError(Target.Value) Then
Preced = False
Else
If Target.Value <> 0 Then Preced = True Else Preced = False
aaa = Target.Address
End If
End Sub
Torna a Applicazioni Office Windows
colora parte di frase/ Parola in stessa cella Autore: raimea |
Forum: Applicazioni Office Windows Risposte: 6 |
Inserire 2 valori nella stessa cella Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 2 |
Incolla prendendo riferimento da cella esterna Autore: scanacc |
Forum: Applicazioni Office Windows Risposte: 4 |
Visitano il forum: Nessuno e 50 ospiti