1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| Private Sub CommandButton1_Click()
Dim Sh As Worksheet
Dim i As Integer
If Controls("Textbox1") = "" Then
MsgBox "Vous devez ABSOLUMENT indiquer Un Nom !", vbExclamation, _
"ERREUR ... Entrez un Nom SVP !"
Controls("Textbox1").SetFocus
Exit Sub
End If
Application.ScreenUpdating = False
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
End With
Selection.Merge
Selection = UserForm1.Textbox1
Unload UserForm1
With Selection.Interior
.Color = 65535
End With
With Selection.Font
.ColorIndex = xlAutomatic
Selection.Font.Bold = True
End With
'#--------------------------------------------------
For Each Sh In Worksheets(Array("janv", "fevr", "mars", "Avr", "Mai", "Juin", "Juil", "Aout", "Sept", "Oct", "Nov", "Dec"))
With Sh
For i = 9 To 73
.Range("B" & i) = 0
If .Range("C" & i).Interior.Color = 65535 Then .Range("B" & i) = .Range("B" & i) + 0.25
If .Range("K" & i).Interior.Color = 65535 Then .Range("B" & i) = .Range("B" & i) + 0.25
If .Range("R" & i).Interior.Color = 65535 Then .Range("B" & i) = .Range("B" & i) + 0.25
If .Range("Y" & i).Interior.Color = 65535 Then .Range("B" & i) = .Range("B" & i) + 0.25
Next i
End With
Next Sh
Sheets("recap_clients").Select
[B3] = UserForm1.Textbox1
[C3] = UserForm1.DTPicker1.Value
Rows("3:3").Select
Selection.Insert Shift:=xlDown
Application.ScreenUpdating = True
End Sub |
Partager