eriiic, j'aurais une question sur le vba ?
Depuis le début je travail sur un docuement crach test avant de propager dans mon document final
J'aimerais adapter le code dans mon document final, la source est la feuille "Import production data" et l'arbre en question se trouve dans la feuille "production tree"
j'ai modifié le code comme suit mais ma feuille reste vierge blanche...
Private Sub CommandButton2_Click()
Dim ref As Range, ok As Boolean
Dim i As Long, col As Long
Application.ScreenUpdating = False
With Sheets("Import production data")
For i = 2 To .Range("A" & .Rows.Count).End(xlUp).Row
For col = 10 To 19
If .Cells(i, col) <> "" Then
Set ref = Worksheets("Import production data").Range("A:A").Find(Worksheets("production tree").Cells(i, col), LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows)
If ref Is Nothing Then
If Worksheets("production tree").Cells(i, col) Like "#####?" Then
Worksheets("production tree").Cells(i, col).Interior.Color = vbRed
ElseIf Len(Worksheets("production tree").Cells(i, col)) > 0 Then
If col > 10 Then
If Worksheets("production tree").Cells(i - 1, col - 1) = "" Then
Worksheets("production tree").Cells(i, col).Interior.Color = Worksheets("production tree").Cells(i - 1, col).Interior.Color
Else
Worksheets("production tree").Cells(i, col).Interior.Color = Worksheets("production tree").Cells(i - 1, col - 1).Interior.Color
End If
End If
End If
Else
If ref.Offset(, 1).Value = 2 Then
Worksheets("production tree").Cells(i, col).Interior.Color = vbGreen
Else
Worksheets("production tree").Cells(i, col).Interior.ColorIndex = 44
End If
End If
End If
Next col
Next i
End With
End Sub
Qu'est ce que j'aurais mal fait ?
Merci d'avance !