Public Ruban As IRibbonUI
Public blnRadio(1 To 3) As Boolean
'Callback for customUI.onLoad
Sub objRuban(ribbon As IRibbonUI)
Set Ruban = ribbon
Ruban.ActivateTab "Projets"
blnRadio(1) = True
Ruban.InvalidateControl "TousProjets"
End Sub
'Callback for TousProjets getImage
Sub TousProjets_getImage(control As IRibbonControl, ByRef returnedVal)
If blnRadio(1) Then
returnedVal = "ActiveXRadioButton"
Else
returnedVal = "ShapeDonut"
End If
End Sub
'Callback for R getImage
Sub R_getImage(control As IRibbonControl, ByRef returnedVal)
If blnRadio(2) Then
returnedVal = "ActiveXRadioButton"
Else
returnedVal = "ShapeDonut"
End If
End Sub
'Callback for P getImage
Sub P_getImage(control As IRibbonControl, ByRef returnedVal)
If blnRadio(3) Then
returnedVal = "ActiveXRadioButton"
Else
returnedVal = "ShapeDonut"
End If
End Sub
'Callback for TousProjets onAction
Sub FiltreTousProjets(control As IRibbonControl)
blnRadio(1) = True
blnRadio(2) = False
blnRadio(3) = False
Ruban.InvalidateControl "TousProjets"
Ruban.InvalidateControl "R"
Ruban.InvalidateControl "P"
Application.ScreenUpdating = False
Rows("1:600").Select
Selection.EntireRow.Hidden = False
Cells(1, 1).Select
'--- code de traitement ---
End Sub
'Callback for R onAction
Sub FiltreR(control As IRibbonControl)
Dim Lign As Integer
blnRadio(1) = False
blnRadio(2) = True
blnRadio(3) = False
Ruban.InvalidateControl "TousProjets"
Ruban.InvalidateControl "R"
Ruban.InvalidateControl "P"
Application.ScreenUpdating = False
Rows("1:1000").Select
Selection.EntireRow.Hidden = False
Lign = 1
For Lign = 1 To 600 Step 1
If Cells(Lign, 1) <> "R" And Cells(Lign, 1) <> "" Then
Rows(Lign & ":" & Lign).Hidden = True
End If
Next Lign
Cells(1, 1).Select
'--- code de traitement ---
End Sub
'Callback for P onAction
Sub FiltreP(control As IRibbonControl)
blnRadio(1) = False
blnRadio(2) = False
blnRadio(3) = True
Ruban.InvalidateControl "TousProjets"
Ruban.InvalidateControl "R"
Ruban.InvalidateControl "P"
Application.ScreenUpdating = False
Rows("1:600").Select
Selection.EntireRow.Hidden = False
Lign = 1
For Lign = 1 To 1000 Step 1
If Cells(Lign, 1) <> "P" And Cells(Lign, 1) <> "" Then
Rows(Lign & ":" & Lign).Hidden = True
End If
Next Lign
Cells(1, 1).Select
'--- code de traitement ---
End Sub