Private Declare Function FindWindowA Lib "User32" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowLongA Lib "User32" _
(ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLongA Lib "User32" _
(ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Sub UserForm_Activate() '### Flag pour faciliter le développement. Rétablir par la suite ###
'Dim hWnd As Long, exLong As Long
'hWnd = FindWindowA(vbNullString, Me.Caption)
'exLong = GetWindowLongA(hWnd, -16)
'If exLong And &H880000 Then
'SetWindowLongA hWnd, -16, exLong And &HFF77FFFF
'Me.Hide: Me.Show
'End If
End Sub
Private Sub CommandButton1_Click()
Dim C As Control
For Each C In Ronde.Controls
If TypeName(C) <> "CommandButton" Then
If C.Tag <> "" Then
If TypeName(C) = "Label" Then
Sheets("Feuil3").Range(C.Tag) = C.Object.Caption
ElseIf TypeName(C) = "CheckBox" Then
Sheets("Feuil3").Range(C.Tag) = Abs(CInt(C.Object.Value))
Else
Sheets("Feuil3").Range(C.Tag) = C.Object.Value
End If
End If
End If
Next C
Unload Me
End Sub
Private Sub UserForm_Initialize()
Dim C As Control
For Each C In Ronde.Controls
If TypeName(C) <> "CommandButton" Then
If C.Tag <> "" Then
If TypeName(C) = "Label" Then
C.Object.Caption = Sheets("Feuil3").Range(C.Tag)
Else
C.Object.Value = Sheets("Feuil3").Range(C.Tag)
End If
End If
End If
Next C
End Sub