Merci Pedro,
J'obtient toujours le même résultat...
Voici le code que Curulis57 m'a pondu il y a peu et que j'essaye de compléter depuis:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
'
Dim iRow%
Dim Lig As Integer
Dim Vartext As String
'
Cancel = True
Application.ScreenUpdating = False
'
'
With Worksheets("EXTRACT")
.Cells.Delete
For x = 2 To Range("A" & Rows.Count).End(xlUp).Row
iRow = iRow + IIf(iRow = 0, 1, 2)
.Range("A" & iRow & ":G" & iRow).Value = Range("A" & x & ":G" & x).Value
iRow = iRow + 1
.Cells(iRow, 2) = Cells(x, 8)
.Cells(iRow, 4) = Cells(x, 9)
.Cells(iRow, 5) = Cells(x, 5)
.Range("H" & iRow & ":I" & iRow).Value = Range("J" & x & ":K" & x).Value
.Cells(iRow, 11) = Cells(x, 13)
If Cells(x, 17) <> 0 Then
.Cells(iRow, 12) = Cells(x, 17)
End If
If Cells(x, 12) = "FOR_ARR_STR" Or Cells(x, 12) = "FOR_ARR_PVC" Or Cells(x, 12) = "CHA_ARR_STR" Or Cells(x, 12) = "CHA_ARR_PVC" Then
iRow = iRow + 1
.Cells(iRow, 2) = Cells(x, 12)
.Cells(iRow, 5) = Cells(x, 5)
.Cells(iRow, 10).Value = "H"
If Cells(x, 21) = "PVC" Then
Vartext = Split(Cells(x, 9), " - ")(0)
.Cells(iRow, 4) = Vartext
Else: .Cells(iRow, 4) = Cells(x, 9)
End If
Else: .Cells(iRow, 10) = Cells(x, 12)
End If
For y = 1 To 3
If Cells(x, 13 + y) <> "" Then
iRow = iRow + 1
.Cells(iRow, 2) = Cells(x, 13 + y)
.Cells(iRow, 5) = Cells(x, 5)
If Left(Cells(x, 13 + y), 5) = "ASS_F" And Left(Cells(x, 13 + y - 1), 3) <> "ASS" Then
.Cells(iRow, 7) = Cells(x, 23)
ElseIf Left(Cells(x, 13 + y), 5) = "ASS_F" And Left(Cells(x, 13 + y - 1), 3) = "ASS" Then
.Cells(iRow, 7) = Cells(x, 24)
ElseIf Left(Cells(x, 13 + y), 5) = "ASS_A" And Left(Cells(x, 13 + y - 1), 5) <> "ASS_A" Then
.Cells(iRow, 7) = Cells(x, 25)
ElseIf Left(Cells(x, 13 + y), 5) = "ASS_A" And Left(Cells(x, 13 + y - 1), 5) = "ASS_A" Then
.Cells(iRow, 7) = Cells(x, 26)
End If
End If
Next
Next
.Activate
Worksheets("EXTRACT").Columns("A:K").EntireColumn.AutoFit
End With
'
Application.ScreenUpdating = True
'
End Sub
Il ne mets pas possible de modifier la référence en ajoutant un caractère, celle-ci se retrouve dans plusieurs bases de données...
Mais je vois une nouvelle réponse de ThauThème que je vais consulter...