bonsoir au forum
je parcours 2 feuilles (S1 & S2) avec condition "Tb(x,18)>0", si oui, inscrit sur une 3 ème feuille (S7), une partie de la ligne source
l'utilisation de "Sel" (lignes 9 & 10) m'est obligatoire au bon fonctionnement de ma sous-proc, mais je doute (comme d'hab) fortement de cette obligation
alors propositions d'amélioration me seraient agréables
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 1 Set S7 = Sheets(7) 2 For Each S In Worksheets(Array(1, 2)) 3 Nbl_12 = S.Range("B" & S.Rows.Count).End(xlUp).Row 4 Tb = S.Range("B1:S" & Nbl_12) 5 For x = 2 To UBound(Tb, 1) 6 If Tb(x, 18) > 0 Then 'montant don 7 i = S.Range("B" & x).FormatConditions(1).Interior.ColorIndex 'récup index couleur fond S 8 Nbl7 = S7.Range("B" & S7.Rows.Count).End(xlUp).Row + 1 9 Sel = S.Range("B" & x & ":S" & x) 10 S7.Range("A" & Nbl7 & ":R" & Nbl7) = Sel 11 S7.Range("A" & Nbl7 & ":R" & Nbl7).Interior.ColorIndex = i 'appli index couleur fond S7 12 End If 13 Next x 14 Next S
merci de m'avoir lu
Partager