'********************************************
'base mouse move pour sheets sans timer
'patricktoulon sur developpez.com
'date:08/10/2017
'********************************************
Public WithEvents cmbrs As CommandBars
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If Sh.Name = "Feuil2" Then
Set cmbrs = Application.CommandBars
Cmbrs_OnUpdate
End If
End Sub
'evenement commandbars
Private Sub Cmbrs_OnUpdate()
Set cell = Getcell_XY
DoEvents
Cells(1, 1) = Format(Now, "hh:nn:ss")
If TypeName(cell) = "Range" Then Cells(1, 2) = cell.Address
Application.CommandBars.FindControl(ID:=2040).Enabled = Not Application.CommandBars.FindControl(ID:=2040).Enabled
End Sub
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
If Sh.Name = "Feuil2" Then Set cmbrs = Nothing
End Sub