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

Filtre ne fonctionne pas après 999

4 réponses
Avatar
Didier NOVARIN
Bonsoir,
La procédure suivante doit me permettre de filtrer suivant un textbox, cela
fonctionne très bien sur les chiffres jusqu'à 999, puis ne trouve pas les
chiffres après 1000
Je vous remercie
Didier

Private Sub CommandButton1_Click()
If Trim(TextBox1) = "" Then
TextBox1 = ""
MsgBox "Vous devez saisir un numéro !", vbExclamation, " Désolé..."
TextBox1.SetFocus
Exit Sub
End If

Application.ScreenUpdating = False
ActiveSheet.Unprotect Password:="toto"
MaVar = TextBox1
Range("A2:AR" & Range("A30000").End(xlUp).Row).AutoFilter Field:=2,
Criteria1:=MaVar
ActiveSheet.Protect Password:="toto"
Application.ScreenUpdating = True
Unload Me
End Sub

4 réponses

Avatar
Philippe.R
Bonsoir,
Quelques informations utiles ici :
http://www.excelabo.net/excel/filtres.php#limitesfiltre
--
http://www.excelabo.net/mpfe/connexion.php
Avec plaisir
Philippe.R
"Didier NOVARIN" a écrit dans le message
de news:%
Bonsoir,
La procédure suivante doit me permettre de filtrer suivant un textbox,
cela fonctionne très bien sur les chiffres jusqu'à 999, puis ne trouve pas
les chiffres après 1000
Je vous remercie
Didier

Private Sub CommandButton1_Click()
If Trim(TextBox1) = "" Then
TextBox1 = ""
MsgBox "Vous devez saisir un numéro !", vbExclamation, " Désolé..."
TextBox1.SetFocus
Exit Sub
End If

Application.ScreenUpdating = False
ActiveSheet.Unprotect Password:="toto"
MaVar = TextBox1
Range("A2:AR" & Range("A30000").End(xlUp).Row).AutoFilter Field:=2,
Criteria1:=MaVar
ActiveSheet.Protect Password:="toto"
Application.ScreenUpdating = True
Unload Me
End Sub




Avatar
JB
ReBonsoir,

Attention TextBox1 est du type chaîne. Il faut peut être le convertir.

MaVar = Cdbl(TextBox1)

JB
On 27 sep, 19:24, "Didier NOVARIN"
wrote:
Bonsoir,
La procédure suivante doit me permettre de filtrer suivant un textbox, cela
fonctionne très bien sur les chiffres jusqu'à 999, puis ne trouve pas les
chiffres après 1000
Je vous remercie
Didier

Private Sub CommandButton1_Click()
If Trim(TextBox1) = "" Then
TextBox1 = ""
MsgBox "Vous devez saisir un numéro !", vbExclamation, " Désolé.. ."
TextBox1.SetFocus
Exit Sub
End If

Application.ScreenUpdating = False
ActiveSheet.Unprotect Password:="toto"
MaVar = TextBox1
Range("A2:AR" & Range("A30000").End(xlUp).Row).AutoFilter Field:=2,
Criteria1:=MaVar
ActiveSheet.Protect Password:="toto"
Application.ScreenUpdating = True
Unload Me
End Sub


Avatar
Didier NOVARIN
Bonsoir Philippe,
En fait, les numéro sont incrémentés
il n'y a donc qu'un numéro par ligne
Je te remercie
Didier


"Philippe.R" <AS_rauphil_chez_wanadoo.fr> a écrit dans le message de news:

Bonsoir,
Quelques informations utiles ici :
http://www.excelabo.net/excel/filtres.php#limitesfiltre
--
http://www.excelabo.net/mpfe/connexion.php
Avec plaisir
Philippe.R
"Didier NOVARIN" a écrit dans le message
de news:%
Bonsoir,
La procédure suivante doit me permettre de filtrer suivant un textbox,
cela fonctionne très bien sur les chiffres jusqu'à 999, puis ne trouve
pas les chiffres après 1000
Je vous remercie
Didier

Private Sub CommandButton1_Click()
If Trim(TextBox1) = "" Then
TextBox1 = ""
MsgBox "Vous devez saisir un numéro !", vbExclamation, " Désolé..."
TextBox1.SetFocus
Exit Sub
End If

Application.ScreenUpdating = False
ActiveSheet.Unprotect Password:="toto"
MaVar = TextBox1
Range("A2:AR" & Range("A30000").End(xlUp).Row).AutoFilter Field:=2,
Criteria1:=MaVar
ActiveSheet.Protect Password:="toto"
Application.ScreenUpdating = True
Unload Me
End Sub







Avatar
Didier NOVARIN
Bonsoir,
Cela ne fonctionne pas.
Je te remercie beaucoup
Didier

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

ReBonsoir,

Attention TextBox1 est du type chaîne. Il faut peut être le convertir.

MaVar = Cdbl(TextBox1)

JB
On 27 sep, 19:24, "Didier NOVARIN"
wrote:
Bonsoir,
La procédure suivante doit me permettre de filtrer suivant un textbox,
cela
fonctionne très bien sur les chiffres jusqu'à 999, puis ne trouve pas les
chiffres après 1000
Je vous remercie
Didier

Private Sub CommandButton1_Click()
If Trim(TextBox1) = "" Then
TextBox1 = ""
MsgBox "Vous devez saisir un numéro !", vbExclamation, " Désolé..."
TextBox1.SetFocus
Exit Sub
End If

Application.ScreenUpdating = False
ActiveSheet.Unprotect Password:="toto"
MaVar = TextBox1
Range("A2:AR" & Range("A30000").End(xlUp).Row).AutoFilter Field:=2,
Criteria1:=MaVar
ActiveSheet.Protect Password:="toto"
Application.ScreenUpdating = True
Unload Me
End Sub