bonsoir,
j'ai un souci pour faire une programation, je souhaiterais programmer un tableau dans la feuille 1 qui renvoie les donnees dans differentes cellules de la feuille 2. actuellement ma programation utulise le programme que le dernier inscrit soit pris en compte, mais je ne peut pas revenir en arriere, pour etre plus clair voici ma prog :
Private Sub CommandButton1_Click()
Dim L As Long, Dernier
For L = 65236 To 262 Step (-1)
If Worksheets("Reception" ).Cells(L, 1).Value <> "" Then
Dernier = Worksheets("Reception" ).Cells(L, 1).Value
Exit For
End If
Next L
Worksheets("Identification" ).Cells(4, 2).Value = Dernier
Sheets("Identification" ).Select
For L = 65236 To 262 Step (-1)
If Worksheets("Reception" ).Cells(L, 1).Value <> "" Then
Dernier = Worksheets("Reception" ).Cells(L, 10).Value
Exit For
End If
Next L
Worksheets("Identification" ).Cells(6, 2).Value = Dernier
Sheets("Identification" ).Select
For L = 65236 To 262 Step (-1)
If Worksheets("Reception" ).Cells(L, 1).Value <> "" Then
Dernier = Worksheets("Reception" ).Cells(L, 9).Value
Exit For
End If
Next L
Worksheets("Identification" ).Cells(7, 2).Value = Dernier
Sheets("Identification" ).Select
For L = 65236 To 262 Step (-1)
If Worksheets("Reception" ).Cells(L, 1).Value <> "" Then
Dernier = Worksheets("Reception" ).Cells(L, 8).Value
Exit For
End If
Next L
Worksheets("Identification" ).Cells(8, 8).Value = Dernier
Sheets("Identification" ).Select
For L = 65236 To 262 Step (-1)
If Worksheets("Reception" ).Cells(L, 1).Value <> "" Then
Dernier = Worksheets("Reception" ).Cells(L, 7).Value
Exit For
Sheets("Identification" ).PrintOut
Sheets("DOCY011C" ).PrintOut
End If
Next L
Worksheets("Identification" ).Cells(2, 2).Value = Dernier
Sheets("Identification" ).Select
For L = 65236 To 262 Step (-1)
If Worksheets("Reception" ).Cells(L, 1).Value <> "" Then
Dernier = Worksheets("Reception" ).Cells(L, 6).Value
Exit For
End If
Next L
Worksheets("Identification" ).Cells(4, 8).Value = Dernier
Sheets("Identification" ).Select
For L = 65236 To 262 Step (-1)
If Worksheets("Reception" ).Cells(L, 1).Value <> "" Then
Dernier = Worksheets("Reception" ).Cells(L, 11).Value
Exit For
End If
Next L
Worksheets("Identification" ).Cells(3, 8).Value = Dernier
Sheets("Identification" ).Select
For L = 65236 To 262 Step (-1)
If Worksheets("Reception" ).Cells(L, 1).Value <> "" Then
Dernier = Worksheets("Reception" ).Cells(L, 12).Value
Exit For
End If
Next L
Worksheets("Identification" ).Cells(5, 8).Value = Dernier
Sheets("Identification" ).Select
For L = 65236 To 262 Step (-1)
If Worksheets("Reception" ).Cells(L, 1).Value <> "" Then
Dernier = Worksheets("Reception" ).Cells(L, 1).Value
Exit For
End If
Next L
Worksheets("DOCY011C" ).Cells(7, 6).Value = Dernier
Sheets("DOCY011C" ).Select
For L = 65236 To 262 Step (-1)
If Worksheets("Reception" ).Cells(L, 1).Value <> "" Then
Dernier = Worksheets("Reception" ).Cells(L, 9).Value
Exit For
End If
Next L
Worksheets("DOCY011C" ).Cells(9, 6).Value = Dernier
Sheets("DOCY011C" ).Select
For L = 65236 To 262 Step (-1)
If Worksheets("Reception" ).Cells(L, 1).Value <> "" Then
Dernier = Worksheets("Reception" ).Cells(L, 7).Value
Exit For
End If
Next L
Worksheets("DOCY011C" ).Cells(3, 3).Value = Dernier
Sheets("DOCY011C" ).Select
For L = 65236 To 262 Step (-1)
If Worksheets("Reception" ).Cells(L, 1).Value <> "" Then
Dernier = Worksheets("Reception" ).Cells(L, 10).Value
Exit For
End If
Next L
Worksheets("DOCY011C" ).Cells(9, 2).Value = Dernier
Sheets("DOCY011C" ).Select
For L = 65236 To 262 Step (-1)
If Worksheets("Reception" ).Cells(L, 1).Value <> "" Then
Dernier = Worksheets("Reception" ).Cells(L, 6).Value
Exit For
End If
Next L
Worksheets("DOCY011C" ).Cells(1, 8).Value = Dernier
Sheets("DOCY011C" ).Select
For L = 65236 To 262 Step (-1)
If Worksheets("Reception" ).Cells(L, 1).Value <> "" Then
Dernier = Worksheets("Reception" ).Cells(L, 4).Value
Exit For
End If
Next L
Worksheets("DOCY011C" ).Cells(7, 2).Value = Dernier
Sheets("DOCY011C" ).Select
For L = 65236 To 262 Step (-1)
If Worksheets("Reception" ).Cells(L, 1).Value <> "" Then
Dernier = Worksheets("Reception" ).Cells(L, 11).Value
Exit For
End If
Next L
Worksheets("DOCY011C" ).Cells(5, 2).Value = Dernier
Sheets("DOCY011C" ).Select
Sheets("Identification" ).PrintOut
Sheets("DOCY011C" ).PrintOut
For L = 65236 To 262 Step (-1)
If Worksheets("Reception" ).Cells(L, 1).Value <> "" Then
Dernier = Worksheets("Reception" ).Cells(L, 4).Value
Exit For
End If
Next L
Worksheets("fiche recap" ).Cells(868, 2).Value = Dernier
Sheets("fiche recap" ).Select
For L = 65236 To 262 Step (-1)
If Worksheets("Reception" ).Cells(L, 1).Value <> "" Then
Dernier = Worksheets("Reception" ).Cells(L, 12).Value
Exit For
End If
Next L
Worksheets("fiche recap" ).Cells(868, 1).Value = Dernier
Sheets("fiche recap" ).Select
For L = 65236 To 262 Step (-1)
If Worksheets("Reception" ).Cells(L, 1).Value <> "" Then
Dernier = Worksheets("Reception" ).Cells(L, 11).Value
Exit For
End If
Next L
Worksheets("fiche recap" ).Cells(868, 3).Value = Dernier
Sheets("fiche recap" ).Select
For L = 65236 To 262 Step (-1)
If Worksheets("Reception" ).Cells(L, 1).Value <> "" Then
Dernier = Worksheets("Reception" ).Cells(L, 7).Value
Exit For
End If
Next L
Worksheets("fiche recap" ).Cells(868, 5).Value = Dernier
Sheets("fiche recap" ).Select
For L = 65236 To 262 Step (-1)
If Worksheets("Reception" ).Cells(L, 1).Value <> "" Then
Dernier = Worksheets("Reception" ).Cells(L, 3).Value
Exit For
End If
Next L
Worksheets("fiche recap" ).Cells(868, 7).Value = Dernier
Sheets("fiche recap" ).Select
End Sub
voila cette programtion est assez longue peut on la simplifier?, sinon mon soucis c soit de cree un autre bouton qui reprend les meme parametres mais que je puisse choisir la ligne(ou un nemro que j'aurais atribue)et que les donnees(les differents colonne) de la ligne trouve se renvoie au differents documents a leur emplacement.
Ou alors completer cette macro pour le faire?
Merci d'avance pour votre aide, je suis pas tres cale en prog je fais juste ca pour mon boulot.
cordialement.
julien.
---------------
julien.