Sub CréerCase()
Dim Cellule As Range
Dim wsResult As Object
Set wsResult = Worksheets("Feuil1")
dercol = Cells(2, Cells.Columns.Count).End(xlToLeft).Offset(0, 0).Column
With wsResult.Range("C2:C" & dercol)
For Each Cellule In Cells(25 + i, 1)
For i = 3 To dercol
With Cellule
ActiveSheet.CheckBoxes.Add(.Left, .Top, .Width, .Height).Select
End With
With Selection
'.LinkedCell = Cellule.Offset(0, 1).Address
.Characters.Text = Cells(2, i).Value
End With
Next i
Next Cellule
End With
End Sub
Sub CréerCase()
Dim Cellule As Range
Dim wsResult As Object
Set wsResult = Worksheets("Feuil1")
dercol = Cells(2, Cells.Columns.Count).End(xlToLeft).Offset(0, 0).Column
With wsResult.Range("C2:C" & dercol)
For i = 3 To dercol
For Each Cellule In Range("A" & i + 25)
With Cellule
ActiveSheet.CheckBoxes.Add(.Left, .Top, .Width, .Height).Select
End With
With Selection
'.LinkedCell = Cellule.Offset(0, 1).Address
.Characters.Text = Cells(2, i).Value
End With
Next Cellule
Next i
End With
End Sub
Sub CréerCase()
Dim Cellule As Range
Dim wsResult As Object
Set wsResult = Worksheets("Feuil1")
With wsResult
dercol = Cells(2, Cells.Columns.Count).End(xlToLeft).Column
i = 3
ligne = 26
For Each Cellule In .Range("C3:C" & dercol)
Set CellDest = Cells(ligne, 1)
ligne = ligne + 1
With CellDest
ActiveSheet.CheckBoxes.Add(.Left, .Top, .Width, .Height).Select
End With
With Selection
.LinkedCell = Columns(ligne).Hidden
.Characters.Text = Cells(2, i).Value
i = i + 1
End With
Next Cellule
End With
End Sub
Sub CréerCase()
Dim Cellule As Range
Dim wsResult As Object
Set wsResult = Worksheets("Feuil1")
With wsResult
dercol = Cells(2, Cells.Columns.Count).End(xlToLeft).Column
i = 3
ligne = 26
For Each ch In ActiveSheet.CheckBoxes
ch.Delete
Next
For Each Cellule In .Range("C3:C" & dercol)
Set CellDest = Cells(ligne, 1)
ligne = ligne + 1
With CellDest
ActiveSheet.CheckBoxes.Add(.Left, .Top, .Width, .Height).Select
End With
With Selection
.OnAction = "clic"
.Characters.Text = Cells(2, i).Value
.Name = "Case" & i
i = i + 1
End With
Next Cellule
End With
End Sub
Sub clic()
Dim i As Integer
dercol = Cells(2, Cells.Columns.Count).End(xlToLeft).Column
For i = 3 To dercol
If CheckBoxes("Case" & i).Value = 1 Then
Columns(i).Hidden = True
Else
Columns(i).Hidden = False
End If
Next i
End Sub
Sub CréerCase()
Dim Cellule As Range
Dim wsResult As Object
Set wsResult = Worksheets("Feuil1")
With wsResult
dercol = Cells(2, Cells.Columns.Count).End(xlToLeft).Column
i = 3
ligne = 26
For Each ch In ActiveSheet.CheckBoxes
ch.Delete
Next
For Each Cellule In .Range("C3:C" & dercol)
Set CellDest = Cells(ligne, 1)
ligne = ligne + 1
With CellDest
ActiveSheet.CheckBoxes.Add(.Left, .Top, .Width, .Height).Select
End With
With Selection
.OnAction = "clic"
.Characters.Text = Cells(2, i).Value
.Value = True
i = i + 1
End With
Next Cellule
End With
End Sub
Sub clic()
Application.ScreenUpdating = False
ActiveSheet.Columns.Hidden = False
For Each ch In ActiveSheet.CheckBoxes
Set c = ActiveSheet.Rows(2).Find(ch.Caption, LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
If ch.Value = 1 Then
Columns(c.Column).Hidden = False
Else
Columns(c.Column).Hidden = True
End If
End If
Next
Application.ScreenUpdating = True
End Sub