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
|
Sub Report_dans_BDD()
Dim DerLig_f1 As Long, DerCol_f1 As Byte, DerLig_f2 As Long
Dim l As Long, c As Byte, x
Dim f1 As Worksheet, f2 As Worksheet
Application.ScreenUpdating = False
Set f1 = Sheets("Données brutes")
Set f2 = Sheets("BDD")
DerLig_f1 = f1.[A1].End(xlDown).Row
DerLig_f2 = 2
For l = 2 To DerLig_f1 Step 2
DerCol_f1 = f1.Cells(l, "A").End(xlToRight).Column
For c = 1 To DerCol_f1
V_Var = f1.Cells(l - 1, c)
Valeur = f1.Cells(l, c)
Set x = f2.Range("A1:T1").Find(V_Var, LookIn:=xlValues, lookat:=xlWhole)
f2.Cells(DerLig_f2, x.Column) = Valeur
Next c
For c = 1 To 20
If f2.Cells(DerLig_f2, c) = "" Then f2.Cells(DerLig_f2, c) = 0
Next c
DerLig_f2 = DerLig_f2 + 1
Next l
Set f1 = Nothing
Set f2 = Nothing
Set x = Nothing
End Sub |
Partager