Sub ajout_art()
Range("A4").Select
Range(Selection, Selection.End(xlDown)).Select
derligstock = Range("A" & Rows.Count).End(xlUp).Row
ActiveWorkbook.Names.Add Name:="base_art", RefersToR1C1:="=Stock!R4C1:R" & derligstock & "C1"
Sheets("Entrée").Select
Range("A4").Select
Range(Selection, Selection.End(xlDown)).Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=base_art"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
Sheets("Sortie").Select
Range("A4").Select
Range(Selection, Selection.End(xlDown)).Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=base_art"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
Sheets("Stock").Select
Range("A4").Select
MsgBox "Mise ˆ jour de la liste des articles effectuée avec succs !"
End Sub