XL 2016 Validation de données

KTM

XLDnaute Impliqué
Salut chers tous
A l'aide de l’éditeur VBA j'ai conçu ce code ci dessous mais il me renvoie une erreur à partir . Surement que j'ai mal rédigé ma macro
Pouvez vous me secourir ? Merci
VB:
Sub m2()
Dim i As Long, T
Application.EnableEvents = False
    Application.ScreenUpdating = False

    T = Array(51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, _
    70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100)
For i = LBound(T) To UBound(T)
       With Worksheets(T(i))
With .Range("J13:J43,J28:J39,J41:J43").Validation
        .Delete
        .Add Type:=xlValidateWholeNumber, AlertStyle:=xlValidAlertStop, _
        Operator:=xlBetween, Formula1:="0", Formula2:="=Menu!$Y$4"
        .IgnoreBlank = True
        .InCellDropdown = True
        .InputTitle = ""
        .ErrorTitle = ""
        .InputMessage = ""
        .ErrorMessage = "Nombre de jours de rupture Invalide"
        .ShowInput = True
        .ShowError = True
    End With
    End With
    Next i
    Application.ScreenUpdating = True
    Application.EnableEvents = True
End Sub
 

Discussions similaires

Statistiques des forums

Discussions
312 100
Messages
2 085 293
Membres
102 853
dernier inscrit
jetstream69