Private Sub SpinButtonStats_Change()
Dim c As Range
Protect "", UserInterfaceOnly:=True 'protection sans mot de passe
If ActiveCell.Formula Like "=ROUND(*)" Then
For Each c In ActiveCell.DirectPrecedents 'Antécédents
c = c + SpinButtonStats
Next
End If
SpinButtonStats = 0
End Sub
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Protect "", UserInterfaceOnly:=True 'protection sans mot de passe
OLEObjects.Placement = 1 'déplace et dimensionne les objets avec les cellules
If Target.Row > 3 Then Cancel = True: Target.EntireRow.Hidden = True
End Sub
Private Sub CommandButtonDem_Click()
Protect "", UserInterfaceOnly:=True 'protection sans mot de passe
Rows.Hidden = False
End Sub
If Not Application.Intersect(Target, Range("M4")) Is Nothing Then
[N4:AX4].ClearContents
End If
Private Sub SpinButtonStats_Change()
Dim c As Range
Protect "", UserInterfaceOnly:=True 'protection sans mot de passe
If ActiveCell.Formula Like "=ROUND(*)" Then
For Each c In ActiveCell.DirectPrecedents 'Antécédents
c = c + SpinButtonStats
Next
ElseIf IsNumeric(CStr(ActiveCell)) Then
ActiveCell = ActiveCell + SpinButtonStats
End If
SpinButtonStats = 0
End Sub
Sub remonterSiLignePlayerVide()
Dim lga As Long, lgn As Long, ncl As Integer, tbc
tbc = Array("N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "AA", "AB", "AC", "AD", "AE", "AF", "AG", "AH", "AI", "AJ", "AK", "AL", "AM", "AN", "AO", "AP", "AQ", "AR", "AS", "AT", "AU", "AV", "AW", "AX", "AY", "AZ", "BA", "BB", "BC", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BK", "BL", "BM", "BN", "BO", "BP", "BQ", "BR", "BS", "BT", "BU", "BV", "BW", "BX", "BY", "BZ", "CA", "CB", "CC", "CD", "CE", "CF", "CG", "CH", "CI", "CJ", "CK", "CL", "CM", "CN", "CO", "CP", "CQ", "CR", "CS", "CT", "CU", "CV", "CW", "CX", "CY", "CZ", "DA", "DB", "DC", "DD", "DE", "DF", "DG", "DH", "DI", "DJ", "DK", "DL", "DM", "DN", "DO", "DP", "DQ", "DR", "DS", "DT", "DU", "DV", "DW", "DX", "DY", "DZ", "EA")
For ncl = 0 To UBound(tbc)
lgn = 5
For lga = 5 To Cells(Rows.Count, tbc(ncl)).End(xlUp).Row
If Cells(lgn, tbc(ncl)) = "" And Cells(lga, tbc(ncl)) <> "" Then
Cells(lgn, tbc(ncl)) = Cells(lga, tbc(ncl))
Cells(lga, tbc(ncl)) = ""
lgn = lgn + 1
End If
Next lga
Next ncl
End Sub
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Protect "", UserInterfaceOnly:=True 'protection sans mot de passe
Set Target = Intersect(Target, Range("M5:M" & Rows.Count))
If Target Is Nothing Then Exit Sub
Cancel = True
Application.ScreenUpdating = False
With Intersect(UsedRange, Range("N4:AX" & Rows.Count))
.Columns(2).Insert xlToRight 'colonne auxiliaire
.Columns(2) = 1
Intersect(Target.EntireRow, .Cells) = "" 'effacement
.Sort .Columns(2) 'tri pour grouper les vides en bas
.Columns(2).Delete xlToLeft
End With
End Sub
Dim flag As Boolean 'mémorise la variable
Private Sub CheckBoxDevAllLignes_Click()
Dim o As OLEObject, coche As Boolean
If flag Then
For Each o In OLEObjects
If TypeName(o.Object) = "CheckBox" And o.Name <> "CheckBoxDevAllLignes" Then If o.Object Then coche = True
Next
CheckBoxDevAllLignes = coche
Else
flag = True
Application.ScreenUpdating = False
For Each o In OLEObjects
If TypeName(o.Object) = "CheckBox" And o.Name <> "CheckBoxDevAllLignes" Then o.Object = CheckBoxDevAllLignes
Next
End If
flag = False 'RAZ
End Sub
Private Sub CheckBoxPers1_Click()
Protect "", UserInterfaceOnly:=True 'protection sans mot de passe
Range("RngPers1").Interior.ColorIndex = IIf(CheckBoxPers1, 4, xlNone)
Range("RngPers1").Locked = CheckBoxPers1
If flag Then Exit Sub
flag = True
CheckBoxDevAllLignes_Click
End Sub
'---etc---
Dim flag As Boolean 'mémorise la variable
Sub Case1_Click()
Dim c As Range, coche As Boolean
If flag Then
For Each c In [A5:A7]
If c Then coche = True
Next
[A4] = coche
Else
[A5:A7] = [A4]
flag = True
Application.ScreenUpdating = False
CaseX_Click
End If
flag = False 'RAZ
End Sub
Sub CaseX_Click()
Dim c As Range, P As Range
Protect "", UserInterfaceOnly:=True 'protection sans mot de passe
For Each c In [A5:A7]
Set P = Intersect(c.EntireRow, [B:E,G:L,N:AX,AZ:BE,BG:BU])
P.Interior.ColorIndex = IIf(c, 4, xlNone)
P.Locked = c
Next
If flag Then Exit Sub
flag = True
Case1_Click
End Sub
Sub Compteur()
Dim c As Range
Protect "", UserInterfaceOnly:=True 'protection sans mot de passe
If ActiveCell.Formula Like "=ROUND(*)" Then
For Each c In ActiveCell.DirectPrecedents 'Antécédents
c = c + [M1] - 1
Next
ElseIf IsNumeric(CStr(ActiveCell)) Then
ActiveCell = ActiveCell + [M1] - 1
End If
[M1] = 1
End Sub
Sub RemiseZeroStats()
With Sheets("Stats")
.Protect "", UserInterfaceOnly:=True 'protection sans mot de passe
.Range("N5:AX" & .Rows.Count).ClearContents
ReacAllLignes
If .[A4] Then .[A4] = False: Run (.CodeName & ".Case1_Click") 'ou Feuil1.Case1_Click
End With
End Sub