Bonjour,
Merci pour ta réponse !
La proposition de Rag02700 était presque parfaite, j'ai juste une modification à faire mais je ne sais pas ou la faire... je m'explique
Dans son code, sur la feuille 'BILAN' quand il insère dans la colonne F la liste des identifiants, les formules dans les colonnes G, H et J s'enlèvent...
Tu sais comment enlever ce problème ?
Sub ListId()
Dim lngLastRowBilan As Long, lngLastRow As Long
Dim rngId1 As Range, rngId2 As Range
With Worksheets("TCD")
lngLastRow = .Range("F" & Rows.Count).End(xlUp).Row
Set rngId1 = .Range("F4:F" & lngLastRow)
lngLastRow = .Range("I" & Rows.Count).End(xlUp).Row
Set rngId2 = .Range("I4:I" & lngLastRow)
' Transformation des ID au bon format dans la colonne CY
.Columns("CY").ClearContents
.Range("CY1").Resize(rngId1.Rows.Count, 1).Value2 = rngId1.Value2
.Range("CY" & (rngId1.Rows.Count + 1)).Resize(rngId2.Rows.Count, 1).Value2 = rngId2.Value2
lngLastRow = .Range("CY" & Rows.Count).End(xlUp).Row
Set rngId1 = .Range("CY1:CY" & lngLastRow)
rngId1.Replace " EMB", "", xlPart
rngId1.RemoveDuplicates Columns:=Array(1), Header:=xlNo
End With
With Worksheets("BILAN")
lngLastRowBilan = .Range("F" & Rows.Count).End(xlUp).Row
.Range("F5:F" & lngLastRowBilan).ClearContents
.Range("F5").Resize(rngId1.Rows.Count, 1).Value2 = rngId1.Value2
End With
End Sub
Merci beaucoup pour ton temps ! :)))