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 46 47 48 49 50
| Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
If Controls("Textbox1") = "" Then
MsgBox "Vous devez ABSOLUMENT indiquer Un Nom !", vbExclamation, _
"ERREUR ... Entrez un Nom SVP !"
Controls("Textbox1").SetFocus
Exit Sub
End If
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
'Sub Macro2(ws As Worksheet)
' Dim i As Integer
'With ws
With Sheets("Janv")
' With Worksheets(Array("Janv", "Fevr", "Mars"))
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
'With Sheets("Fevr")
' 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
Application.ScreenUpdating = True
Range("A1").Select
End Sub |