Private Sub Worksheet_SelectionChange(ByVal Target As Range)
ActiveSheet.CheckBox1.Value = ([f19] = 1)
ActiveSheet.CheckBox2.Value = ([G19] = 1)
End Sub
Dim i As Byte
For i = 1 To 33
ActiveSheet.OLEObjects("CheckBox" & i).Object = IIf(Cells(19, i + 5) = 1, 1, 0)
Next
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, [f6:al18]) Is Nothing And Target.Count = 1 Then
Dim i As Byte
For i = 1 To 33
ActiveSheet.OLEObjects("CheckBox" & i).Object = IIf(Cells(19, i + 5) = 1, 1, 0)
Next
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal C As Range)
If Intersect(C, Range("F19:G19")) Is Nothing Then Exit Sub
Cells(3, C.Column).Value = Cells(3, C.Column).Value
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, [F19:M19]) Is Nothing And Target.Count = 1 Then
Dim i As Byte
For i = 1 To 8
ActiveSheet.OLEObjects("CheckBox" & i).Object = IIf(Cells(19, i + 5) = 1, 1, 0)
If Cells(19, i + 5) = 1 Then macro1
Next
End If
End Sub
Sub macro1()
MsgBox "aa"
End Sub
Private Sub CheckBox1_Click()
If Range("f19") = 1 Then
Range("f3").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End If
End Sub
[CODE]Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, [F19:M19]) Is Nothing And Target.Count = 1 Then
Dim i As Byte
For i = 1 To 8
ActiveSheet.OLEObjects("CheckBox" & i).Object = IIf(Cells(19, i + 5) = 1, 1, 0)
If Cells(19, i + 5) = 1 Then
Cells(19 - 16, i + 5).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End If
Next
End If
End Sub
Private Sub test2()
Dim x As OLEObject
Dim i As Long
For Each x In OLEObjects
i = CLng(Right$(x.Name, Len(x.Name) - 8)) + 5
If Cells(19, i) = 1 Then
'exemple je copie la date une cellule plus bas
Cells(20, i) = Cells(3, i)
End If
Next
End Sub