Bonjour à tous, je suis très content de rejoindre ce forum.
J'aimerai vote aide svp, je me lance un peu sur le VBA et malgré mes recherches sur d'ancien post je n'ai pas trouvé
de solution.
Je souhaite créé une application pour rechercher des mots dans la colonne A afin de les copiers ensuite dans la colonne B.
J'ai donc enregistrer une macro (avec le petit boutton en bas) et j'ai utilisé Ctrl+F. Ca marche plutôt bien mais le problème c'est que si ma macro ne trouve pas le mot recherché il y a une erreur
Ca fais une petite semaine que j'essaye mais sans succès, notamment avec Application.DisplayAlerts=False
Voici mon code
Merci à tous
J'aimerai vote aide svp, je me lance un peu sur le VBA et malgré mes recherches sur d'ancien post je n'ai pas trouvé
de solution.
Je souhaite créé une application pour rechercher des mots dans la colonne A afin de les copiers ensuite dans la colonne B.
J'ai donc enregistrer une macro (avec le petit boutton en bas) et j'ai utilisé Ctrl+F. Ca marche plutôt bien mais le problème c'est que si ma macro ne trouve pas le mot recherché il y a une erreur
Ca fais une petite semaine que j'essaye mais sans succès, notamment avec Application.DisplayAlerts=False
Voici mon code
Code:
Sub coller()
'
' coller Macro
'
'
Range("A:A,G:G").Select
Selection.ClearContents
Range("A1").Select
ActiveSheet.PasteSpecial Format:="Texte", Link:=False, DisplayAsIcon:= _
False
Range("A1").Select
Cells.Find(What:="N° d'affaire", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Selection.Copy
Range("G1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Cells.Find(What:="Fournisseur", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Selection.Copy
Range("G2").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Cells.Find(What:="Identifiant du Point de Livraison", After:=ActiveCell, _
LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False).Activate
Selection.Copy
ActiveWindow.SmallScroll Down:=-33
Range("G3").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Cells.Find(What:="Etat du point de livraison", After:=ActiveCell, LookIn _
:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
Selection.Copy
ActiveWindow.SmallScroll Down:=-42
Range("G4").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Cells.Find(What:="Alimentation", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Selection.Copy
ActiveWindow.SmallScroll Down:=-36
Range("G5").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Cells.Find(What:="Catégorie du client", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
Selection.Copy
ActiveWindow.SmallScroll Down:=-39
Range("G6").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Cells.Find(What:="Civilité", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Selection.Copy
ActiveWindow.SmallScroll Down:=-60
Range("G7").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Cells.Find(What:="Nom", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
Selection.Copy
ActiveWindow.SmallScroll Down:=-60
Range("G8").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Cells.Find(What:="Prénom", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Selection.Copy
ActiveWindow.SmallScroll Down:=-60
Range("G9").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Cells.Find(What:="Téléphone", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Cells.FindNext(After:=ActiveCell).Activate
Cells.Find(What:="Téléphone du client", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
Selection.Copy
ActiveWindow.SmallScroll Down:=-60
Range("G10").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Cells.Find(What:="Option de prestation", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
Cells.FindNext(After:=ActiveCell).Activate
Selection.Copy
ActiveWindow.SmallScroll Down:=-96
Range("G11").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Cells.Find(What:="Type d'offre", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Selection.Copy
ActiveWindow.SmallScroll Down:=-96
Range("G12").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Cells.Find(What:="Structure de comptage", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
Selection.Copy
ActiveWindow.SmallScroll Down:=-102
Range("G13").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Cells.Find(What:="Puissance souscrite demandée", After:=ActiveCell, LookIn _
:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
Selection.Copy
ActiveWindow.SmallScroll Down:=-108
Range("G14").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Cells.Find(What:="Code tarif DISCO", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
Selection.Copy
ActiveWindow.SmallScroll Down:=-105
Range("G15").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Cells.Find(What:="Standard de réalisation", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
Cells.FindNext(After:=ActiveCell).Activate
Selection.Copy
ActiveWindow.SmallScroll Down:=-138
Range("G16").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Cells.Find(What:="Commentaire", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Selection.Copy
ActiveWindow.SmallScroll Down:=-147
Range("G17").Select
ActiveSheet.Paste
ActiveWindow.SmallScroll Down:=-21
Range("A1").Select
End Sub
Merci à tous