roby
XLDnaute Occasionnel
Bonsoir le Forum
une petite question,
peut-on attribuer par un simple click ou double click dans une Zone1 une macro1 sans pour autant que celle-ci se declanche sur toute les feuilles?
exemple de code dans ThisWorkBook:
Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Zone1 As Range, Cancel As Boolean)
'Double Click - Zone Heures / Poste
'----------------------------------
If Not Application.Intersect(Zone1, Range("Plan!E16:M46")) Is Nothing Then UsfHeures.Show
If Not Application.Intersect(Zone1, Range("Plan:O16:O46")) Is Nothing Then UsfPostes.Show
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Zone2 As Range)
'Simple Click - Zone Heures / Poste
'----------------------------------
If Not Application.Intersect(Zone2, Range("Plan!E16:M46")) Is Nothing Then UsfHeures.Show
If Not Application.Intersect(Zone2, Range("Plan!O16:O46")) Is Nothing Then UsfPostes.Show
ou bien dans la feuille Plan ajouter:
Private Sub Worksheet_BeforeDoubleClick(ByVal Zone As Range, Cancel As Boolean)
'Double Click - Ticket
'---------------------
If Not Intersect([X16:X46], Zone) Is Nothing Then Zone.Value = IIf(Zone.Value = "", "T", "")
'Double Click - Régularisation Paie
'----------------------------------
If Not Intersect([Y16:Y46], Zone) Is Nothing Then Zone.Value = IIf(Zone.Value = "", "R", "")
End Sub
merci d'avance Roby
une petite question,
peut-on attribuer par un simple click ou double click dans une Zone1 une macro1 sans pour autant que celle-ci se declanche sur toute les feuilles?
exemple de code dans ThisWorkBook:
Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Zone1 As Range, Cancel As Boolean)
'Double Click - Zone Heures / Poste
'----------------------------------
If Not Application.Intersect(Zone1, Range("Plan!E16:M46")) Is Nothing Then UsfHeures.Show
If Not Application.Intersect(Zone1, Range("Plan:O16:O46")) Is Nothing Then UsfPostes.Show
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Zone2 As Range)
'Simple Click - Zone Heures / Poste
'----------------------------------
If Not Application.Intersect(Zone2, Range("Plan!E16:M46")) Is Nothing Then UsfHeures.Show
If Not Application.Intersect(Zone2, Range("Plan!O16:O46")) Is Nothing Then UsfPostes.Show
ou bien dans la feuille Plan ajouter:
Private Sub Worksheet_BeforeDoubleClick(ByVal Zone As Range, Cancel As Boolean)
'Double Click - Ticket
'---------------------
If Not Intersect([X16:X46], Zone) Is Nothing Then Zone.Value = IIf(Zone.Value = "", "T", "")
'Double Click - Régularisation Paie
'----------------------------------
If Not Intersect([Y16:Y46], Zone) Is Nothing Then Zone.Value = IIf(Zone.Value = "", "R", "")
End Sub
merci d'avance Roby