Bonsoir
j'essai à partir de l'exemple ci-dessous d'ajouter un clignotement dans le
textbox,
afin que si l'utilisateur n'a rien saisie, après le msgbox, le textbox
clignote:
J'ai une procédure qui me fait clignoter une cellule, mais je ne sais pas du
tout comment l'adapter ;-)
Merci pour votre aide
Flo riant
'Nom
If TextBox2 = "" Then
MsgBox "Vous devez saisir un nom," & vbNewLine & _
"sinon vous ne pouvez pas valider la saisie.", vbExclamation, _
" Nom ?"
TextBox2.SetFocus
Exit Sub
End If
'Clignotement de cellule
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub Clignote_cell()
ActiveSheet.Unprotect Password:="toto"
Dim i As Byte
For i = 1 To 6
Sleep 100
With ActiveCell.Interior
.ColorIndex = 2
End With
Sleep 100
With ActiveCell.Interior
.ColorIndex = 4
End With
Next i
ActiveCell.Interior.ColorIndex = 0
ActiveSheet.Protect Password:="toto"
End Sub
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
garnote
Salut Florian
Une piste :
For i = 1 To 500 TextBox1.Visible = False DoEvents TextBox1.Visible = True DoEvents Next i
Serge
"Florian" a écrit dans le message de news: uf%23S%
Bonsoir j'essai à partir de l'exemple ci-dessous d'ajouter un clignotement dans le textbox, afin que si l'utilisateur n'a rien saisie, après le msgbox, le textbox clignote: J'ai une procédure qui me fait clignoter une cellule, mais je ne sais pas du tout comment l'adapter ;-) Merci pour votre aide Flo riant
'Nom If TextBox2 = "" Then MsgBox "Vous devez saisir un nom," & vbNewLine & _ "sinon vous ne pouvez pas valider la saisie.", vbExclamation, _ " Nom ?" TextBox2.SetFocus Exit Sub End If
'Clignotement de cellule Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Sub Clignote_cell() ActiveSheet.Unprotect Password:="toto" Dim i As Byte For i = 1 To 6 Sleep 100 With ActiveCell.Interior .ColorIndex = 2 End With Sleep 100 With ActiveCell.Interior .ColorIndex = 4 End With Next i ActiveCell.Interior.ColorIndex = 0 ActiveSheet.Protect Password:="toto" End Sub
Salut Florian
Une piste :
For i = 1 To 500
TextBox1.Visible = False
DoEvents
TextBox1.Visible = True
DoEvents
Next i
Serge
"Florian" <florian@toto.fr> a écrit dans le message de news:
uf%23S%23skgFHA.3692@TK2MSFTNGP09.phx.gbl...
Bonsoir
j'essai à partir de l'exemple ci-dessous d'ajouter un clignotement dans le
textbox,
afin que si l'utilisateur n'a rien saisie, après le msgbox, le textbox
clignote:
J'ai une procédure qui me fait clignoter une cellule, mais je ne sais pas
du tout comment l'adapter ;-)
Merci pour votre aide
Flo riant
'Nom
If TextBox2 = "" Then
MsgBox "Vous devez saisir un nom," & vbNewLine & _
"sinon vous ne pouvez pas valider la saisie.", vbExclamation, _
" Nom ?"
TextBox2.SetFocus
Exit Sub
End If
'Clignotement de cellule
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub Clignote_cell()
ActiveSheet.Unprotect Password:="toto"
Dim i As Byte
For i = 1 To 6
Sleep 100
With ActiveCell.Interior
.ColorIndex = 2
End With
Sleep 100
With ActiveCell.Interior
.ColorIndex = 4
End With
Next i
ActiveCell.Interior.ColorIndex = 0
ActiveSheet.Protect Password:="toto"
End Sub
For i = 1 To 500 TextBox1.Visible = False DoEvents TextBox1.Visible = True DoEvents Next i
Serge
"Florian" a écrit dans le message de news: uf%23S%
Bonsoir j'essai à partir de l'exemple ci-dessous d'ajouter un clignotement dans le textbox, afin que si l'utilisateur n'a rien saisie, après le msgbox, le textbox clignote: J'ai une procédure qui me fait clignoter une cellule, mais je ne sais pas du tout comment l'adapter ;-) Merci pour votre aide Flo riant
'Nom If TextBox2 = "" Then MsgBox "Vous devez saisir un nom," & vbNewLine & _ "sinon vous ne pouvez pas valider la saisie.", vbExclamation, _ " Nom ?" TextBox2.SetFocus Exit Sub End If
'Clignotement de cellule Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Sub Clignote_cell() ActiveSheet.Unprotect Password:="toto" Dim i As Byte For i = 1 To 6 Sleep 100 With ActiveCell.Interior .ColorIndex = 2 End With Sleep 100 With ActiveCell.Interior .ColorIndex = 4 End With Next i ActiveCell.Interior.ColorIndex = 0 ActiveSheet.Protect Password:="toto" End Sub
Florian
Bonjour Garnote et merci content de te re lire ;-) Cela va tellement vite, que l'on ne voit rien ;-) Flo riant
"garnote" a écrit dans le message de news: %23Ew$
Salut Florian
Une piste :
For i = 1 To 500 TextBox1.Visible = False DoEvents TextBox1.Visible = True DoEvents Next i
Serge
"Florian" a écrit dans le message de news: uf%23S%
Bonsoir j'essai à partir de l'exemple ci-dessous d'ajouter un clignotement dans le textbox, afin que si l'utilisateur n'a rien saisie, après le msgbox, le textbox clignote: J'ai une procédure qui me fait clignoter une cellule, mais je ne sais pas du tout comment l'adapter ;-) Merci pour votre aide Flo riant
'Nom If TextBox2 = "" Then MsgBox "Vous devez saisir un nom," & vbNewLine & _ "sinon vous ne pouvez pas valider la saisie.", vbExclamation, _ " Nom ?" TextBox2.SetFocus Exit Sub End If
'Clignotement de cellule Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Sub Clignote_cell() ActiveSheet.Unprotect Password:="toto" Dim i As Byte For i = 1 To 6 Sleep 100 With ActiveCell.Interior .ColorIndex = 2 End With Sleep 100 With ActiveCell.Interior .ColorIndex = 4 End With Next i ActiveCell.Interior.ColorIndex = 0 ActiveSheet.Protect Password:="toto" End Sub
Bonjour Garnote et merci
content de te re lire ;-)
Cela va tellement vite, que l'on ne voit rien ;-)
Flo riant
"garnote" <rien@absent.com> a écrit dans le message de news:
%23Ew$C6kgFHA.3436@tk2msftngp13.phx.gbl...
Salut Florian
Une piste :
For i = 1 To 500
TextBox1.Visible = False
DoEvents
TextBox1.Visible = True
DoEvents
Next i
Serge
"Florian" <florian@toto.fr> a écrit dans le message de news:
uf%23S%23skgFHA.3692@TK2MSFTNGP09.phx.gbl...
Bonsoir
j'essai à partir de l'exemple ci-dessous d'ajouter un clignotement dans
le textbox,
afin que si l'utilisateur n'a rien saisie, après le msgbox, le textbox
clignote:
J'ai une procédure qui me fait clignoter une cellule, mais je ne sais pas
du tout comment l'adapter ;-)
Merci pour votre aide
Flo riant
'Nom
If TextBox2 = "" Then
MsgBox "Vous devez saisir un nom," & vbNewLine & _
"sinon vous ne pouvez pas valider la saisie.", vbExclamation, _
" Nom ?"
TextBox2.SetFocus
Exit Sub
End If
'Clignotement de cellule
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub Clignote_cell()
ActiveSheet.Unprotect Password:="toto"
Dim i As Byte
For i = 1 To 6
Sleep 100
With ActiveCell.Interior
.ColorIndex = 2
End With
Sleep 100
With ActiveCell.Interior
.ColorIndex = 4
End With
Next i
ActiveCell.Interior.ColorIndex = 0
ActiveSheet.Protect Password:="toto"
End Sub
Bonjour Garnote et merci content de te re lire ;-) Cela va tellement vite, que l'on ne voit rien ;-) Flo riant
"garnote" a écrit dans le message de news: %23Ew$
Salut Florian
Une piste :
For i = 1 To 500 TextBox1.Visible = False DoEvents TextBox1.Visible = True DoEvents Next i
Serge
"Florian" a écrit dans le message de news: uf%23S%
Bonsoir j'essai à partir de l'exemple ci-dessous d'ajouter un clignotement dans le textbox, afin que si l'utilisateur n'a rien saisie, après le msgbox, le textbox clignote: J'ai une procédure qui me fait clignoter une cellule, mais je ne sais pas du tout comment l'adapter ;-) Merci pour votre aide Flo riant
'Nom If TextBox2 = "" Then MsgBox "Vous devez saisir un nom," & vbNewLine & _ "sinon vous ne pouvez pas valider la saisie.", vbExclamation, _ " Nom ?" TextBox2.SetFocus Exit Sub End If
'Clignotement de cellule Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Sub Clignote_cell() ActiveSheet.Unprotect Password:="toto" Dim i As Byte For i = 1 To 6 Sleep 100 With ActiveCell.Interior .ColorIndex = 2 End With Sleep 100 With ActiveCell.Interior .ColorIndex = 4 End With Next i ActiveCell.Interior.ColorIndex = 0 ActiveSheet.Protect Password:="toto" End Sub
garnote
Tu pourrais peut-être ajouter un dodo!
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) For i = 1 To 500 TextBox1.Visible = False Sleep(50) DoEvents TextBox1.Visible = True DoEvents Sleep(50) Next i
"Florian" a écrit dans le message de news:
Bonjour Garnote et merci content de te re lire ;-) Cela va tellement vite, que l'on ne voit rien ;-) Flo riant
"garnote" a écrit dans le message de news: %23Ew$
Salut Florian
Une piste :
For i = 1 To 500 TextBox1.Visible = False DoEvents TextBox1.Visible = True DoEvents Next i
Serge
"Florian" a écrit dans le message de news: uf%23S%
Bonsoir j'essai à partir de l'exemple ci-dessous d'ajouter un clignotement dans le textbox, afin que si l'utilisateur n'a rien saisie, après le msgbox, le textbox clignote: J'ai une procédure qui me fait clignoter une cellule, mais je ne sais pas du tout comment l'adapter ;-) Merci pour votre aide Flo riant
'Nom If TextBox2 = "" Then MsgBox "Vous devez saisir un nom," & vbNewLine & _ "sinon vous ne pouvez pas valider la saisie.", vbExclamation, _ " Nom ?" TextBox2.SetFocus Exit Sub End If
'Clignotement de cellule
Sub Clignote_cell() ActiveSheet.Unprotect Password:="toto"
Dim i As Byte For i = 1 To 6 Sleep 100 With ActiveCell.Interior .ColorIndex = 2 End With Sleep 100 With ActiveCell.Interior .ColorIndex = 4 End With Next i ActiveCell.Interior.ColorIndex = 0 ActiveSheet.Protect Password:="toto" End Sub
Tu pourrais peut-être ajouter un dodo!
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
For i = 1 To 500
TextBox1.Visible = False
Sleep(50)
DoEvents
TextBox1.Visible = True
DoEvents
Sleep(50)
Next i
"Florian" <florian@toto.fr> a écrit dans le message de news:
u5ar7PlgFHA.2632@TK2MSFTNGP09.phx.gbl...
Bonjour Garnote et merci
content de te re lire ;-)
Cela va tellement vite, que l'on ne voit rien ;-)
Flo riant
"garnote" <rien@absent.com> a écrit dans le message de news:
%23Ew$C6kgFHA.3436@tk2msftngp13.phx.gbl...
Salut Florian
Une piste :
For i = 1 To 500
TextBox1.Visible = False
DoEvents
TextBox1.Visible = True
DoEvents
Next i
Serge
"Florian" <florian@toto.fr> a écrit dans le message de news:
uf%23S%23skgFHA.3692@TK2MSFTNGP09.phx.gbl...
Bonsoir
j'essai à partir de l'exemple ci-dessous d'ajouter un clignotement dans
le textbox,
afin que si l'utilisateur n'a rien saisie, après le msgbox, le textbox
clignote:
J'ai une procédure qui me fait clignoter une cellule, mais je ne sais
pas du tout comment l'adapter ;-)
Merci pour votre aide
Flo riant
'Nom
If TextBox2 = "" Then
MsgBox "Vous devez saisir un nom," & vbNewLine & _
"sinon vous ne pouvez pas valider la saisie.", vbExclamation, _
" Nom ?"
TextBox2.SetFocus
Exit Sub
End If
'Clignotement de cellule
Sub Clignote_cell()
ActiveSheet.Unprotect Password:="toto"
Dim i As Byte
For i = 1 To 6
Sleep 100
With ActiveCell.Interior
.ColorIndex = 2
End With
Sleep 100
With ActiveCell.Interior
.ColorIndex = 4
End With
Next i
ActiveCell.Interior.ColorIndex = 0
ActiveSheet.Protect Password:="toto"
End Sub
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) For i = 1 To 500 TextBox1.Visible = False Sleep(50) DoEvents TextBox1.Visible = True DoEvents Sleep(50) Next i
"Florian" a écrit dans le message de news:
Bonjour Garnote et merci content de te re lire ;-) Cela va tellement vite, que l'on ne voit rien ;-) Flo riant
"garnote" a écrit dans le message de news: %23Ew$
Salut Florian
Une piste :
For i = 1 To 500 TextBox1.Visible = False DoEvents TextBox1.Visible = True DoEvents Next i
Serge
"Florian" a écrit dans le message de news: uf%23S%
Bonsoir j'essai à partir de l'exemple ci-dessous d'ajouter un clignotement dans le textbox, afin que si l'utilisateur n'a rien saisie, après le msgbox, le textbox clignote: J'ai une procédure qui me fait clignoter une cellule, mais je ne sais pas du tout comment l'adapter ;-) Merci pour votre aide Flo riant
'Nom If TextBox2 = "" Then MsgBox "Vous devez saisir un nom," & vbNewLine & _ "sinon vous ne pouvez pas valider la saisie.", vbExclamation, _ " Nom ?" TextBox2.SetFocus Exit Sub End If
'Clignotement de cellule
Sub Clignote_cell() ActiveSheet.Unprotect Password:="toto"
Dim i As Byte For i = 1 To 6 Sleep 100 With ActiveCell.Interior .ColorIndex = 2 End With Sleep 100 With ActiveCell.Interior .ColorIndex = 4 End With Next i ActiveCell.Interior.ColorIndex = 0 ActiveSheet.Protect Password:="toto" End Sub
Hervé
Bonsoir Florian Teste le code ci-dessous (à mettre dans le module de ta Form). Pour le test, tu clique sur la Form : Private Declare Function GetTickCount Lib "Kernel32" () As Long
Sub Minuterie(Milliseconde As Long) Dim Arret As Long Arret = GetTickCount() + Milliseconde Do While GetTickCount() < Arret DoEvents Loop End Sub
Sub Clignote() Dim I As Integer Do While I < 10 TextBox1.BackColor = &HFF& Minuterie 500 TextBox1.BackColor = &H80000005 Minuterie 500 I = I + 1 Loop End Sub
Private Sub UserForm_Click() Clignote End Sub
Hervé.
"Florian" a écrit dans le message news: uf#S#
Bonsoir j'essai à partir de l'exemple ci-dessous d'ajouter un clignotement dans le textbox, afin que si l'utilisateur n'a rien saisie, après le msgbox, le textbox clignote: J'ai une procédure qui me fait clignoter une cellule, mais je ne sais pas du
tout comment l'adapter ;-) Merci pour votre aide Flo riant
'Nom If TextBox2 = "" Then MsgBox "Vous devez saisir un nom," & vbNewLine & _ "sinon vous ne pouvez pas valider la saisie.", vbExclamation, _ " Nom ?" TextBox2.SetFocus Exit Sub End If
'Clignotement de cellule Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Sub Clignote_cell() ActiveSheet.Unprotect Password:="toto" Dim i As Byte For i = 1 To 6 Sleep 100 With ActiveCell.Interior .ColorIndex = 2 End With Sleep 100 With ActiveCell.Interior .ColorIndex = 4 End With Next i ActiveCell.Interior.ColorIndex = 0 ActiveSheet.Protect Password:="toto" End Sub
Bonsoir Florian
Teste le code ci-dessous (à mettre dans le module de ta Form). Pour le test,
tu clique sur la Form :
Private Declare Function GetTickCount Lib "Kernel32" () As Long
Sub Minuterie(Milliseconde As Long)
Dim Arret As Long
Arret = GetTickCount() + Milliseconde
Do While GetTickCount() < Arret
DoEvents
Loop
End Sub
Sub Clignote()
Dim I As Integer
Do While I < 10
TextBox1.BackColor = &HFF&
Minuterie 500
TextBox1.BackColor = &H80000005
Minuterie 500
I = I + 1
Loop
End Sub
Private Sub UserForm_Click()
Clignote
End Sub
Hervé.
"Florian" <florian@toto.fr> a écrit dans le message news:
uf#S#skgFHA.3692@TK2MSFTNGP09.phx.gbl...
Bonsoir
j'essai à partir de l'exemple ci-dessous d'ajouter un clignotement dans le
textbox,
afin que si l'utilisateur n'a rien saisie, après le msgbox, le textbox
clignote:
J'ai une procédure qui me fait clignoter une cellule, mais je ne sais pas
du
tout comment l'adapter ;-)
Merci pour votre aide
Flo riant
'Nom
If TextBox2 = "" Then
MsgBox "Vous devez saisir un nom," & vbNewLine & _
"sinon vous ne pouvez pas valider la saisie.", vbExclamation, _
" Nom ?"
TextBox2.SetFocus
Exit Sub
End If
'Clignotement de cellule
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub Clignote_cell()
ActiveSheet.Unprotect Password:="toto"
Dim i As Byte
For i = 1 To 6
Sleep 100
With ActiveCell.Interior
.ColorIndex = 2
End With
Sleep 100
With ActiveCell.Interior
.ColorIndex = 4
End With
Next i
ActiveCell.Interior.ColorIndex = 0
ActiveSheet.Protect Password:="toto"
End Sub
Bonsoir Florian Teste le code ci-dessous (à mettre dans le module de ta Form). Pour le test, tu clique sur la Form : Private Declare Function GetTickCount Lib "Kernel32" () As Long
Sub Minuterie(Milliseconde As Long) Dim Arret As Long Arret = GetTickCount() + Milliseconde Do While GetTickCount() < Arret DoEvents Loop End Sub
Sub Clignote() Dim I As Integer Do While I < 10 TextBox1.BackColor = &HFF& Minuterie 500 TextBox1.BackColor = &H80000005 Minuterie 500 I = I + 1 Loop End Sub
Private Sub UserForm_Click() Clignote End Sub
Hervé.
"Florian" a écrit dans le message news: uf#S#
Bonsoir j'essai à partir de l'exemple ci-dessous d'ajouter un clignotement dans le textbox, afin que si l'utilisateur n'a rien saisie, après le msgbox, le textbox clignote: J'ai une procédure qui me fait clignoter une cellule, mais je ne sais pas du
tout comment l'adapter ;-) Merci pour votre aide Flo riant
'Nom If TextBox2 = "" Then MsgBox "Vous devez saisir un nom," & vbNewLine & _ "sinon vous ne pouvez pas valider la saisie.", vbExclamation, _ " Nom ?" TextBox2.SetFocus Exit Sub End If
'Clignotement de cellule Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Sub Clignote_cell() ActiveSheet.Unprotect Password:="toto" Dim i As Byte For i = 1 To 6 Sleep 100 With ActiveCell.Interior .ColorIndex = 2 End With Sleep 100 With ActiveCell.Interior .ColorIndex = 4 End With Next i ActiveCell.Interior.ColorIndex = 0 ActiveSheet.Protect Password:="toto" End Sub
Florian
Bonsoir et désolé, je dois rapidement m'absenter ;-( Je teste donc demain et vous tiens au courant.. Bonne soirée Flo riant
"Hervé" a écrit dans le message de news:
Bonsoir Florian Teste le code ci-dessous (à mettre dans le module de ta Form). Pour le test, tu clique sur la Form : Private Declare Function GetTickCount Lib "Kernel32" () As Long
Sub Minuterie(Milliseconde As Long) Dim Arret As Long Arret = GetTickCount() + Milliseconde Do While GetTickCount() < Arret DoEvents Loop End Sub
Sub Clignote() Dim I As Integer Do While I < 10 TextBox1.BackColor = &HFF& Minuterie 500 TextBox1.BackColor = &H80000005 Minuterie 500 I = I + 1 Loop End Sub
Private Sub UserForm_Click() Clignote End Sub
Hervé.
"Florian" a écrit dans le message news: uf#S#
Bonsoir j'essai à partir de l'exemple ci-dessous d'ajouter un clignotement dans le textbox, afin que si l'utilisateur n'a rien saisie, après le msgbox, le textbox clignote: J'ai une procédure qui me fait clignoter une cellule, mais je ne sais pas du
tout comment l'adapter ;-) Merci pour votre aide Flo riant
'Nom If TextBox2 = "" Then MsgBox "Vous devez saisir un nom," & vbNewLine & _ "sinon vous ne pouvez pas valider la saisie.", vbExclamation, _ " Nom ?" TextBox2.SetFocus Exit Sub End If
'Clignotement de cellule Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Sub Clignote_cell() ActiveSheet.Unprotect Password:="toto" Dim i As Byte For i = 1 To 6 Sleep 100 With ActiveCell.Interior .ColorIndex = 2 End With Sleep 100 With ActiveCell.Interior .ColorIndex = 4 End With Next i ActiveCell.Interior.ColorIndex = 0 ActiveSheet.Protect Password:="toto" End Sub
Bonsoir et désolé, je dois rapidement m'absenter ;-(
Je teste donc demain et vous tiens au courant..
Bonne soirée
Flo riant
"Hervé" <hmsilve@wanadoo.fr> a écrit dans le message de news:
OivobhlgFHA.1148@TK2MSFTNGP12.phx.gbl...
Bonsoir Florian
Teste le code ci-dessous (à mettre dans le module de ta Form). Pour le
test,
tu clique sur la Form :
Private Declare Function GetTickCount Lib "Kernel32" () As Long
Sub Minuterie(Milliseconde As Long)
Dim Arret As Long
Arret = GetTickCount() + Milliseconde
Do While GetTickCount() < Arret
DoEvents
Loop
End Sub
Sub Clignote()
Dim I As Integer
Do While I < 10
TextBox1.BackColor = &HFF&
Minuterie 500
TextBox1.BackColor = &H80000005
Minuterie 500
I = I + 1
Loop
End Sub
Private Sub UserForm_Click()
Clignote
End Sub
Hervé.
"Florian" <florian@toto.fr> a écrit dans le message news:
uf#S#skgFHA.3692@TK2MSFTNGP09.phx.gbl...
Bonsoir
j'essai à partir de l'exemple ci-dessous d'ajouter un clignotement dans
le
textbox,
afin que si l'utilisateur n'a rien saisie, après le msgbox, le textbox
clignote:
J'ai une procédure qui me fait clignoter une cellule, mais je ne sais pas
du
tout comment l'adapter ;-)
Merci pour votre aide
Flo riant
'Nom
If TextBox2 = "" Then
MsgBox "Vous devez saisir un nom," & vbNewLine & _
"sinon vous ne pouvez pas valider la saisie.", vbExclamation, _
" Nom ?"
TextBox2.SetFocus
Exit Sub
End If
'Clignotement de cellule
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub Clignote_cell()
ActiveSheet.Unprotect Password:="toto"
Dim i As Byte
For i = 1 To 6
Sleep 100
With ActiveCell.Interior
.ColorIndex = 2
End With
Sleep 100
With ActiveCell.Interior
.ColorIndex = 4
End With
Next i
ActiveCell.Interior.ColorIndex = 0
ActiveSheet.Protect Password:="toto"
End Sub
Bonsoir et désolé, je dois rapidement m'absenter ;-( Je teste donc demain et vous tiens au courant.. Bonne soirée Flo riant
"Hervé" a écrit dans le message de news:
Bonsoir Florian Teste le code ci-dessous (à mettre dans le module de ta Form). Pour le test, tu clique sur la Form : Private Declare Function GetTickCount Lib "Kernel32" () As Long
Sub Minuterie(Milliseconde As Long) Dim Arret As Long Arret = GetTickCount() + Milliseconde Do While GetTickCount() < Arret DoEvents Loop End Sub
Sub Clignote() Dim I As Integer Do While I < 10 TextBox1.BackColor = &HFF& Minuterie 500 TextBox1.BackColor = &H80000005 Minuterie 500 I = I + 1 Loop End Sub
Private Sub UserForm_Click() Clignote End Sub
Hervé.
"Florian" a écrit dans le message news: uf#S#
Bonsoir j'essai à partir de l'exemple ci-dessous d'ajouter un clignotement dans le textbox, afin que si l'utilisateur n'a rien saisie, après le msgbox, le textbox clignote: J'ai une procédure qui me fait clignoter une cellule, mais je ne sais pas du
tout comment l'adapter ;-) Merci pour votre aide Flo riant
'Nom If TextBox2 = "" Then MsgBox "Vous devez saisir un nom," & vbNewLine & _ "sinon vous ne pouvez pas valider la saisie.", vbExclamation, _ " Nom ?" TextBox2.SetFocus Exit Sub End If
'Clignotement de cellule Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Sub Clignote_cell() ActiveSheet.Unprotect Password:="toto" Dim i As Byte For i = 1 To 6 Sleep 100 With ActiveCell.Interior .ColorIndex = 2 End With Sleep 100 With ActiveCell.Interior .ColorIndex = 4 End With Next i ActiveCell.Interior.ColorIndex = 0 ActiveSheet.Protect Password:="toto" End Sub