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
| Sub Intégration()
'
' Intégration donnees Macro
'
'
Dim Numcpte
Dim Période
Dim jour
Dim Libelle
Dim Debit
Dim Centre
Dim NumPiece
Dim erreur
Dim x
Dim w
Dim y
Dim z
'Recherche de ligne vide
For y = 2 To 1000
If Cells(y, 1) = "" Then
w = y
GoTo Saut
End If
Next y
Saut:
'Recherche et Intégration des Données
For x = 2 To 100
Selection.ClearContents
Sheets("PECS").Select
Numcpte = Cells(x, 2)
Période = Cells(x, 6)
jour = Cells(x, 7)
Libelle = Cells(x, 9)
Debit = Cells(x, 11)
NumPiece = Cells(x, 17)
Centre = Cells(x, 48)
Sheets("Donnees").Select
z = x + w
Cells(z, 1) = "PECS"
Cells(z, 2) = Numcpte
Cells(z, 3) = Période
Cells(z, 4) = jour
Cells(z, 5) = Libelle
Cells(z, 6) = Debit
Cells(z, 7) = Centre
Cells(z, 8) = NumPiece
Next x
M:
Sheets("Donnees").Select
End Sub |
Partager