Bonjour,
Je vous écris aujourd'hui car j'ai quelques problèmes avec un macro VBA,
Je m'explique j'aurais aimé compléter un tableau avec une sorte de présélection. Toutes les informations nécessaires se situent sur une feuille et les information à compléter sur une autre, le macro devrait simplement en reconnaissant les noms compléter l'ensemble de la ligne correspondante.
Si on prend dans mon fichier la feuil2 c'est celle qui contient les informations, et la Feuil1 serait la feuille à compléter à partir de la feuille 2. Seul le nom est renseigné & donc il faudrait que ca complète le reste.
Sub Test()
Dim nomdate As String
Sheets("Feuil1").Select
Range("C2", Range("C2").End(xlDown)).Select
Dim Cel As Range
For Each Cel In Range("C2", Range("C2").End(xlDown))
Selection.Copy
Sheets("Feuil2").Select
Set resultat = ActiveSheet.Columns(3).Cells.Find(What:=Cel.Value, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False)
If resultat Is Nothing Then
MsgBox " non trouvé"
Else
resultat.Select
End If
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
Sheets("Feuil1").Select
ActiveSheet.Paste
Next Cel
End Sub
Le code est faux et me met une erreur d'excution'13': Incompatibilité de type.
Merci d'avance pour votre aide,
Cordialement,
LaSouried