1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| Sub Liste_Long_Reduite_Appro_Alu()
a = Workbooks("Appro Alu Fer.xlsm").Sheets("Appro Alu").Cells(1, 6).Value
b = Workbooks("Appro Alu Fer.xlsm").Sheets("Donnees Alu").Cells(1, 9).Value
For i = 3 To a + 2 'Appro Alu
x = 0
Z = 0
w = 0
For j = 2 To b 'Donnees Alu
If Workbooks("Appro Alu Fer.xlsm").Sheets("Donnees Alu").Cells(j, 2).Value = Workbooks("Appro Alu Fer.xlsm").Sheets("Appro Alu").Cells(i, 1).Value Then
Z = j
w = 1
For k = 1 To 20
If Workbooks("Appro Alu Fer.xlsm").Sheets("Donnees Alu").Cells(j + k, 2).Value = Workbooks("Appro Alu Fer.xlsm").Sheets("Appro Alu").Cells(i, 1).Value Then
x = x + 1
End If
Next k
End If
If w = 1 Then
With Sheets("Appro Alu").Cells(i, 3).Validation
.Delete
'-------------------------------------- >>> Problème ligne suivante <<<<<------------------
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formule:="=" & "Donnees Alu!" & Range(Cells(Z, 3), Cells(Z + x, 3)).Address
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End If
Next j
Next i
End Sub |
Partager