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
|
'Initialisation Onglet remise de Chèque
Sheets("Remise cheques").Activate
last_ligne = Range("A10000").End(xlUp).Row
numero_dernier_bordereau = Cells(last_ligne, 1).Value
ligne_bleue_debut = 6
ligne_bleue_fin = 0
ligne = 11
P1 = 0
Do While ligne_bleue_debut < 1000
'init feuille de calcul
If P1 = 0 Then
Sheets("Remise cheques").Range("A6:Z10000").Select
Selection.Delete Shift:=xlUp
Sheets("Remise cheques").Range("F6").Select
ActiveCell.FormulaR1C1 = _
"=IF(VLOOKUP(RC[-5],Compte!R4C2:R258C7,6,FALSE)="""","""",VLOOKUP(RC[-5],Compte!R4C2:R258C7,6,FALSE))"
Sheets("Remise cheques").Range("A6").Select
P1 = 1
End If
'mise en forme
'Sheets("Remise cheques").Activate
Range("A" & ligne_bleue_debut & ":F" & ligne_bleue_debut).Select
With Selection.Interior
.ColorIndex = 34
.Pattern = xlSolid
End With
Sheets("Remise cheques").Range("F6").Select
Selection.Copy
Cells(ligne_bleue_debut, 6).Select
Selection.PasteSpecial Paste:=xlFormulas, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
ligne_bleue_debut = ligne_bleue_debut + 1
ligne_bleue_fin = ligne_bleue_debut + ligne
Sheets("Remise cheques").Range(Cells(ligne_bleue_debut, 1), Cells(ligne_bleue_fin, 1)).Select
Selection.Rows.Group
ligne_bleue_debut = ligne_bleue_fin + 2
Loop |
Partager