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
| Sub LVAL()
Dim varPN As String
Dim Nom As Name
For Each Nom In ThisWorkbook.Names
If Nom.Name = "EQLAN008" Then Nom.delete
Next Nom
varPN = "EQLAN008"
ThisWorkbook.Names.Add Name:=varPN, RefersToR1C1:= _
"='Controleur-Site'!R1C:R2C2"
Range("C5").Select
With Selection.Validation
.delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=INDIRECT(" & varPN & ")"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End Sub |
Partager