Je me suis fait aider par l'un de vous pour faire une Macro dans un fichier excel pour importer certaines données.
Par exemple : quand dans le fichier 1 il y a marqué "VOIE COTE ROUTE", la valeur de la colonne B devra être retranscrit dans le fichier 2. (voir macro si dessous).
J'aimerais continuer cette macro mais cette fois pour les "VOIE MILIEU" etc... je pensais qu'en ayant la base je pourrais me débrouiller seule, sauf qu'apparemment non...
J'aurais donc besoin de votre aide et de vos compétences pour m'aider à continuer cette macro... SVP...
voici la macro qu'on m'a faite :
Sub Essai()
Dim wb As Workbook
Dim ws As Worksheet
Dim derLigne As Long
Application.DisplayAlerts = False
Set wb = Workbooks.Open("P:\INFRALOG\URA\COMMUN_UNITE\28_Parc_SES\Stagiaires\Anne-Charlotte\KIZEO\Essai Macro\Essai Macro KIZEO.xlsx")
Application.DisplayAlerts = True
Set ws = wb.Sheets("PLF")
totalLignes = ws.UsedRange.Rows.Count
Dim valeurCherchee As String
For i = 1 To totalLignes
valeurCherchee = Cells(i, 1).Value
'MsgBox valeurCherchee
If valeurCherchee = "VOIE COTE ROUTE " Then
TargetWorkbook.Sheets("PLF").Range("B" & derLigne) = ws.Cells(i, 2).Value
derLigne = derLigne + 1
End If