Hello,
il serait bon d'annuler le ontime comme ceci
Dim tempo
Private Sub Worksheet_Activate()
If ActiveSheet.Name = "liste" Then
tempo = Now + TimeValue("00:00:10")
Application.OnTime tempo, "fermer_session"
End If
End Sub
Private Sub Worksheet_Deactivate()
On Error Resume Next
Application.OnTime tempo, "fermer_session", , False
End Sub
Hello,
il serait bon d'annuler le ontime comme ceci
Dim tempo
Private Sub Worksheet_Activate()
If ActiveSheet.Name = "liste" Then
tempo = Now + TimeValue("00:00:10")
Application.OnTime tempo, "fermer_session"
End If
End Sub
Private Sub Worksheet_Deactivate()
On Error Resume Next
Application.OnTime tempo, "fermer_session", , False
End Sub
Merci ça marche bien.
Y-a-t-il un code qui peut l'arrêter si la cellule ("C7") <>""
J'ai ajouté ce code ci-dessous mais ça ne marche pas.
Dim Mouv
Mouv=activesheet.range("C7").value
Private Sub worksheet_change(ByVal Target as range)
If Mouv<>"" then
application.ontime tempo, "fermer_session", , false
End if
End sub
Bon qlq modif à faire.
En Module1 mettre en 1ère ligne
Public tempo
effacer le Dim tempo en code de worksheet
en Private Sub worksheet_change(ByVal Target as range)
if [C7]<>"" then Application.Ontime tempo, "fermer_session", , false
End Sub