validation de cellule et plage variable

G

Goutedo

Guest
Bonjour à tous.

Avec un enregistrement macro, j'ai le code suivant:

Private Sub nouv_tract_Click()
Range("R3").Select
Selection.Insert Shift:=xlDown
Range("G7").Select
ActiveCell.SpecialCells(xlCellTypeSameValidation).Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:="=$R$2:$R$5"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End Sub


Comment faire pour que la plage "=$R$2:$R$5" soit variable en fonction du
nombre d'occurence qu'il y a entre R2 et Rx ?

Merci pour votre aide

Goutedo
 

Discussions similaires

Statistiques des forums

Discussions
312 226
Messages
2 086 414
Membres
103 204
dernier inscrit
alaa20dine01