Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Régle de validation Liste

3 réponses
Avatar
Michel B
Bonjour à tous,

je souhaite créer une liste sur une colonne"B" avec un contenue variable, B1
étant l'intitulé est exclu.

j'ai créé avec une macro avec l'assistant et copié le code :

With Sheets("Structure")
If (.Range("T2")) = "CNDS" Then

Sheets("Adherents").Select
Columns("B:B").Select
Selection.EntireColumn.Hidden = False
Columns("B:B").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=
_
xlBetween, Formula1:="C;D;E;L;L>C;L>E;L>D"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = "Type licence"
.ErrorTitle = "Erreur Type licence"
.InputMessage = "Sélectionner dans la liste"
.ErrorMessage = "Vous devez sélectionner le type de licence dans la
liste déroulante"
.ShowInput = True
.ShowError = True
End With
Range("B1").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateInputOnly, AlertStyle:=xlValidAlertStop,
Operator _
:=xlBetween
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With

Range("D2").Select
End If
End With

With Sheets("Structure")
If (.Range("T2")) = "CNADS" Then

Sheets("Adherents").Select
Columns("B:B").Select
Selection.EntireColumn.Hidden = False
Columns("B:B").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=
_
xlBetween, Formula1:="C;D;E;L"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = "Type licence"
.ErrorTitle = "Erreur Type licence"
.InputMessage = "Sélectionner dans la liste"
.ErrorMessage = "Vous devez sélectionner le type de licence dans la
liste"
.ShowInput = True
.ShowError = True
End With
Range("B1").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateInputOnly, AlertStyle:=xlValidAlertStop,
Operator _
:=xlBetween
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
Range("D2").Select
End If
End With

Elle me renvoie :
C;D;E;L;L>C;L>E;L>D ou C;D;E;L
au lieu de :
C
D
E
L
L>C
L>E
L>D

ou

C
D
E
L

je sais que cela a voir avec les apostrophes mais ne sais comment contourner
le problème.

Si vous avez une solution d'avance merci

Michel

3 réponses

Avatar
Misange
Bonjour

Ouh là ! j'ai pas tout lu mais ça m'a l'air achté compliqué ton truc ;-)
insertion nom définir : malisteÞcaler(feuil1!B2;;;nbval($B:$B)-1)
(sous réserve qu'il n'y ait pas de blancs dans ta liste et rien d'autre
que l'intitulé et tes données dans la colonne B)
ensuite données/validation/liste =maliste.

Misange migrateuse
XlWiki : Participez à un travail collaboratif sur excel !
http://xlwiki.free.fr/wiki
http://www.excelabo.net

Bonjour à tous,

je souhaite créer une liste sur une colonne"B" avec un contenue variable, B1
étant l'intitulé est exclu.

j'ai créé avec une macro avec l'assistant et copié le code :

With Sheets("Structure")
If (.Range("T2")) = "CNDS" Then

Sheets("Adherents").Select
Columns("B:B").Select
Selection.EntireColumn.Hidden = False
Columns("B:B").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=
_
xlBetween, Formula1:="C;D;E;L;L>C;L>E;L>D"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = "Type licence"
.ErrorTitle = "Erreur Type licence"
.InputMessage = "Sélectionner dans la liste"
.ErrorMessage = "Vous devez sélectionner le type de licence dans la
liste déroulante"
.ShowInput = True
.ShowError = True
End With
Range("B1").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateInputOnly, AlertStyle:=xlValidAlertStop,
Operator _
:=xlBetween
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With

Range("D2").Select
End If
End With

With Sheets("Structure")
If (.Range("T2")) = "CNADS" Then

Sheets("Adherents").Select
Columns("B:B").Select
Selection.EntireColumn.Hidden = False
Columns("B:B").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=
_
xlBetween, Formula1:="C;D;E;L"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = "Type licence"
.ErrorTitle = "Erreur Type licence"
.InputMessage = "Sélectionner dans la liste"
.ErrorMessage = "Vous devez sélectionner le type de licence dans la
liste"
.ShowInput = True
.ShowError = True
End With
Range("B1").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateInputOnly, AlertStyle:=xlValidAlertStop,
Operator _
:=xlBetween
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
Range("D2").Select
End If
End With

Elle me renvoie :
C;D;E;L;L>C;L>E;L>D ou C;D;E;L
au lieu de :
C
D
E
L
L>C
L>E
L>D

ou

C
D
E
L

je sais que cela a voir avec les apostrophes mais ne sais comment contourner
le problème.

Si vous avez une solution d'avance merci

Michel




Avatar
JB
Bonoir,

Il faut séparer les items par ,:

xlBetween, Formula1:="C,D,E,L"

JB
http://boisgontierjacques.free.fr


On 14 juin, 10:25, "Michel B" wrote:
Bonjour à tous,

je souhaite créer une liste sur une colonne"B" avec un contenue variable , B1
étant l'intitulé est exclu.

j'ai créé avec une macro avec l'assistant et copié le code :

    With Sheets("Structure")
          If (.Range("T2")) = "CNDS" Then

    Sheets("Adherents").Select
    Columns("B:B").Select
    Selection.EntireColumn.Hidden = False
        Columns("B:B").Select
    With Selection.Validation
        .Delete
        .Add Type:=xlValidateList, AlertStyle:=xlValidAlertSto p, Operator:=
_
        xlBetween, Formula1:="C;D;E;L;L>C;L>E;L>D"
        .IgnoreBlank = True
        .InCellDropdown = True
        .InputTitle = "Type licence"
        .ErrorTitle = "Erreur Type licence"
        .InputMessage = "Sélectionner dans la liste"
        .ErrorMessage = "Vous devez sélectionner le type de li cence dans la
liste déroulante"
        .ShowInput = True
        .ShowError = True
    End With
    Range("B1").Select
    With Selection.Validation
        .Delete
        .Add Type:=xlValidateInputOnly, AlertStyle:=xlValidAle rtStop,
Operator _
        :=xlBetween
        .IgnoreBlank = True
        .InCellDropdown = True
        .InputTitle = ""
        .ErrorTitle = ""
        .InputMessage = ""
        .ErrorMessage = ""
        .ShowInput = True
        .ShowError = True
    End With

    Range("D2").Select
            End If
    End With

    With Sheets("Structure")
          If (.Range("T2")) = "CNADS" Then

    Sheets("Adherents").Select
    Columns("B:B").Select
    Selection.EntireColumn.Hidden = False
        Columns("B:B").Select
    With Selection.Validation
        .Delete
        .Add Type:=xlValidateList, AlertStyle:=xlValidAlertSto p, Operator:=
_
        xlBetween, Formula1:="C;D;E;L"
        .IgnoreBlank = True
        .InCellDropdown = True
        .InputTitle = "Type licence"
        .ErrorTitle = "Erreur Type licence"
        .InputMessage = "Sélectionner dans la liste"
        .ErrorMessage = "Vous devez sélectionner le type de li cence dans la
liste"
        .ShowInput = True
        .ShowError = True
    End With
    Range("B1").Select
    With Selection.Validation
        .Delete
        .Add Type:=xlValidateInputOnly, AlertStyle:=xlValidAle rtStop,
Operator _
        :=xlBetween
        .IgnoreBlank = True
        .InCellDropdown = True
        .InputTitle = ""
        .ErrorTitle = ""
        .InputMessage = ""
        .ErrorMessage = ""
        .ShowInput = True
        .ShowError = True
    End With
    Range("D2").Select
            End If
    End With

Elle me renvoie :
C;D;E;L;L>C;L>E;L>D ou C;D;E;L
 au lieu de :
C
D
E
L
L>C
L>E
L>D

ou

C
D
E
L

je sais que cela a voir avec les apostrophes mais ne sais comment contourn er
le problème.

Si vous avez une solution d'avance merci

Michel


Avatar
Michel B
Super ,

ça marche

Encore merci
Michel


"JB" a écrit dans le message de news:

Bonoir,

Il faut séparer les items par ,:

xlBetween, Formula1:="C,D,E,L"

JB
http://boisgontierjacques.free.fr


On 14 juin, 10:25, "Michel B" wrote:
Bonjour à tous,

je souhaite créer une liste sur une colonne"B" avec un contenue variable,
B1
étant l'intitulé est exclu.

j'ai créé avec une macro avec l'assistant et copié le code :

With Sheets("Structure")
If (.Range("T2")) = "CNDS" Then

Sheets("Adherents").Select
Columns("B:B").Select
Selection.EntireColumn.Hidden = False
Columns("B:B").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator: > _
xlBetween, Formula1:="C;D;E;L;L>C;L>E;L>D"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = "Type licence"
.ErrorTitle = "Erreur Type licence"
.InputMessage = "Sélectionner dans la liste"
.ErrorMessage = "Vous devez sélectionner le type de licence dans la
liste déroulante"
.ShowInput = True
.ShowError = True
End With
Range("B1").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateInputOnly, AlertStyle:=xlValidAlertStop,
Operator _
:=xlBetween
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With

Range("D2").Select
End If
End With

With Sheets("Structure")
If (.Range("T2")) = "CNADS" Then

Sheets("Adherents").Select
Columns("B:B").Select
Selection.EntireColumn.Hidden = False
Columns("B:B").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator: > _
xlBetween, Formula1:="C;D;E;L"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = "Type licence"
.ErrorTitle = "Erreur Type licence"
.InputMessage = "Sélectionner dans la liste"
.ErrorMessage = "Vous devez sélectionner le type de licence dans la
liste"
.ShowInput = True
.ShowError = True
End With
Range("B1").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateInputOnly, AlertStyle:=xlValidAlertStop,
Operator _
:=xlBetween
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
Range("D2").Select
End If
End With

Elle me renvoie :
C;D;E;L;L>C;L>E;L>D ou C;D;E;L
au lieu de :
C
D
E
L
L>C
L>E
L>D

ou

C
D
E
L

je sais que cela a voir avec les apostrophes mais ne sais comment
contourner
le problème.

Si vous avez une solution d'avance merci

Michel