Thierry, j'ai modifie, un bon debut, et bonne nouvelle, ca marche tres bien, mais mon total n'es pas vraiment correct, a mon avis il ne compte pas tous, jusqu'au bout, dis moi si je dois changer quoi, mon total dois apparaitre en AG3 au lieu de K dans ton exemple d'origine:
Option Explicit
Dim DerLigne As Integer
Dim PlageList As String
Private Sub Label1_Click()
End Sub
Private Sub UserForm_Initialize()
CommandButton1.Visible = False
DerLigne = Sheets("januari").Range("A65536").End(xlUp).Row
PlageList = Sheets("januari").Range("A3:AG10" & DerLigne).Address
ListBox1.ColumnCount = 32
ListBox1.RowSource = "Januari!" & PlageList
ListBox1.ColumnWidths = "2,5cm;0,6cm;0,6cm;0,6cm;0,6cm;0,6cm;0,6cm;0,6cm;0,6cm;0,6cm;0,6cm;0,6cm;0,6cm;0,6cm;0,6cm;0,6cm;0,6cm;0,6cm;0,6cm;0,6cm;0,6cm;0,6cm;0,6cm;0,6cm;0,6cm;0,6cm;0,6cm;0,6cm;0,6cm;0,6cm;0,6cm;0,6cm"
ComboBox1.AddItem "8"
ComboBox1.AddItem "10"
ComboBox1.AddItem "12"
ComboBox1.Value = "8"
End Sub
Private Sub ListBox1_Click()
CommandButton1.Visible = True
End Sub
Private Sub CommandButton1_Click()
Dim Cell As Range
Dim Maplage As Range
Dim i As Integer
Dim R As Integer
Set Maplage = Sheets("januari").Range("a3:a" & DerLigne)
On Error GoTo Sortie
R = ComboBox1.Value
For Each Cell In Maplage
If Cell = ListBox1 Then
i = Cell.Row
Cells(i, 33).Formula = "=SUM(COUNTIF(B" & i & ":AG" & i & ",""DS"")*12," _
& "COUNTIF(B" & i & ":AG" & i & ",""NS"")*12," _
& "COUNTIF(B" & i & ":AG" & i & ",""DR"")*12," _
& "COUNTIF(B" & i & ":AG" & i & ",""NR"")*12," _
& "COUNTIF(B" & i & ":AG" & i & ",""V"")*8," _
& "COUNTIF(B" & i & ":AG" & i & ",""VX"")*8," _
& "COUNTIF(B" & i & ":AG" & i & ",""L"")*8," _
& "COUNTIF(B" & i & ":AG" & i & ",""BV"")*6,17," _
& "COUNTIF(B" & i & ":AG" & i & ",""LX"")*8," _
& "COUNTIF(B" & i & ":AG" & i & ",""V1"")*9," _
& "COUNTIF(B" & i & ":AG" & i & ",""V2"")*9," _
& "COUNTIF(B" & i & ":AG" & i & ",""L1"")*9," _
& "COUNTIF(B" & i & ":AG" & i & ",""L2"")*9," _
& "COUNTIF(B" & i & ":AG" & i & ",""D2"")*12," _
& "COUNTIF(B" & i & ":AG" & i & ",""D4"")*10," _
& "COUNTIF(B" & i & ":AG" & i & ",""D5"")*12," _
& "COUNTIF(B" & i & ":AG" & i & ",""N2"")*9," _
& "COUNTIF(B" & i & ":AG" & i & ",""DB"")*12," _
& "COUNTIF(B" & i & ":AG" & i & ",""DH"")*12," _
& "COUNTIF(B" & i & ":AG" & i & ",""NH"")*12," _
& "COUNTIF(B" & i & ":AG" & i & ",""S"")*3," _
& "COUNTIF(B" & i & ":AG" & i & ",""AD"")*8," _
& "COUNTIF(B" & i & ":AG" & i & ",""EV"")*2,58," _
& "COUNTIF(B" & i & ":AG" & i & ",""ZK"")*6,17," _
& "COUNTIF(B" & i & ":AG" & i & ",""R"")*" & R & ")"
End If
Next
Exit Sub
Sortie:
MsgBox "Entrez un Valeur Numérique Entiere dans la TextBox, Petit Malin !! lol", _
vbCritical, "Thierry's Mini Démo"
End Sub
Merci
Christohpe