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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
| Private Sub CmdButton7_Click()
Dim y As Long, e As Long, f As Long, g As Long, h As Long
Dim i As Integer, test As Boolean, sh As Worksheet
'test = False
For Each sh In ThisWorkbook.Worksheets
test = False
If sh.Name = "Aout" Then
test = True
Exit For
End If
Next sh
If test = True Then
'renseignement de la colonne de Aout
With Sheets("Aout")
For i = 1 To 300
y = Sheets("Aout").Cells(i, 1) 'on récupère la valeur du numéro de compte
e = Sheets("Aout").Cells(i, 3) 'récupère la valeur de la colonne mvt débit
f = Sheets("Aout").Cells(i, 4) 'récupère la valeur de la colonne mvt crédit
g = Sheets("Aout").Cells(i, 5) 'récupère la valeur de la colonne solde débit
h = Sheets("Aout").Cells(i, 6) 'récupère la valeur de la colonne solde crédit
If y = "411105" Then
Sheets("gestion").Cells(7, 14) = e
End If
If y = "411104" Then
Sheets("gestion").Cells(8, 14) = e
End If
If y = "411410" Then
Sheets("gestion").Cells(9, 14) = f
End If
If y = "411107" Then
Sheets("gestion").Cells(11, 14) = g
End If
If y = "411108" Then
Sheets("gestion").Cells(12, 14) = g
End If
If y = "443" Then
Sheets("gestion").Cells(14, 14) = f
End If
If y = "601101" Then
Sheets("gestion").Cells(19, 14) = e
End If
If y = "601102" Then
Sheets("gestion").Cells(20, 14) = h
End If
If y = "601104" Then
Sheets("gestion").Cells(21, 14) = h
End If
If y = "601199" Then
Sheets("gestion").Cells(22, 14) = e
End If
If y = "601201" Then
Sheets("gestion").Cells(23, 14) = e
End If
If y = "445" Then
Sheets("gestion").Cells(25, 14) = f
Next i
End With
End If
End Sub |
Partager