Bonjour,

Ça ne fonctionne pas, il me dit "Next sans For"

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
Sub test1()
Dim relance As Worksheet
Dim suiv As Worksheet
Dim codepayeur As String
Dim sin As String
Dim montant As Currency
 
'Affectation variable avec les onglets
 
Set relance = Sheets("RELANCES CIES CORPOREL")
Set suiv = Sheets("SUIVTRANS RELANCES BCF MANDAT")
 
suiv.Activate
 
Dernligne = suiv.Range("H" & Rows.Count).End(xlUp).Row
relance.Activate
 
 
For j = 2 To Dernligne
 
'sasie donées
    If Cells(j, 5) = "FRA-BCF" Then
        'Si FRA-BCF
        relance.Cells(j, 1) = "RELANCE_BCF GESTION_ FRA-BCF" & "_" & relance.Cells(j, 6).Value & relance.Cells(j, 4).Value & "/" & relance.Cells(j, 5).Value & ""
    If Cells(j, 5) = "MANDAT RELANCE CIE" Then
        'Si autre que FRA-BCF
        relance.Cells(j, 1) = "RELANCE MANDAT" & "_" & relance.Cells(j, 3).Value & "_" & relance.Cells(j, 5).Value & relance.Cells(j, 6).Value & "_" & relance.Cells(j, 5).Value & "_" & " Bodily claim " & relance.Cells(j, 4).Value
        '[Nom compagnie] Bodily(Material) claim [n°sin AZ]/[ref compagnie] pending list Q1 2019 AZ France
    If Cells(j, 5) = "MANDAT AG" Then
    relance.Cells(j, 1) = "AG BCF MANDAT" & "_" & relance.Cells(j, 3).Value & "_" & relance.Cells(j, 5).Value & relance.Cells(j, 6).Value & "_" & relance.Cells(j, 5).Value & "_" & " Bodily claim " & relance.Cells(j, 4).Value
 
    If Cells(j, 5) = "MANDAT RELANCE AG" Then
    relance.Cells(j, 1) = "RELANCE AG BCF MANDAT" & "_" & relance.Cells(j, 3).Value & "_" & relance.Cells(j, 5).Value & relance.Cells(j, 6).Value & "_" & relance.Cells(j, 5).Value & "_" & " Bodily claim " & relance.Cells(j, 4).Value
 
    End If
 
End Sub