Ajouter dans une cellule les checkbox avec un + au milieu
5 réponses
Michel
Bonjour à toutes et tous
J'ai un userform avec ce code :
Je souhaite que si l'utilisateur coche par exemple le checkbox1 et le 3
dans la cellule active, il y a : alpha + charly
merci et bonne soirée
Michel
Private Sub CommandButton1_Click()
If CheckBox1 Then
ActiveCell.Value = "alpha"
End If
If CheckBox2 Then
ActiveCell.Value = "bêta"
End If
If CheckBox3 Then
ActiveCell.Value = "charly"
End If
If CheckBox4 Then
ActiveCell.Value = "echo"
End If
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
FxM
Bonjour à toutes et tous J'ai un userform avec ce code : Je souhaite que si l'utilisateur coche par exemple le checkbox1 et le 3 dans la cellule active, il y a : alpha + charly merci et bonne soirée Michel
Private Sub CommandButton1_Click() If CheckBox1 Then ActiveCell.Value = "alpha" End If If CheckBox2 Then ActiveCell.Value = "bêta" End If If CheckBox3 Then ActiveCell.Value = "charly" End If If CheckBox4 Then ActiveCell.Value = "echo" End If End Sub
Bonsoir,
Non testé :
Private Sub CommandButton1_Click() txt = "" If CheckBox1 Then txt = txt & "@alpha" End If If CheckBox2 Then txt = txt & "@bêta" End If If CheckBox3 Then txt = txt &"@charly" End If If CheckBox4 Then txt = txt & "@echo" End If if left(txt,1)="@" then txt = right(txt,len(txt)-1) txt = replace(txt , "@" , " + ") activecell.value = txt End Sub
@+ FxM
Bonjour à toutes et tous
J'ai un userform avec ce code :
Je souhaite que si l'utilisateur coche par exemple le checkbox1 et le 3
dans la cellule active, il y a : alpha + charly
merci et bonne soirée
Michel
Private Sub CommandButton1_Click()
If CheckBox1 Then
ActiveCell.Value = "alpha"
End If
If CheckBox2 Then
ActiveCell.Value = "bêta"
End If
If CheckBox3 Then
ActiveCell.Value = "charly"
End If
If CheckBox4 Then
ActiveCell.Value = "echo"
End If
End Sub
Bonsoir,
Non testé :
Private Sub CommandButton1_Click()
txt = ""
If CheckBox1 Then
txt = txt & "@alpha"
End If
If CheckBox2 Then
txt = txt & "@bêta"
End If
If CheckBox3 Then
txt = txt &"@charly"
End If
If CheckBox4 Then
txt = txt & "@echo"
End If
if left(txt,1)="@" then txt = right(txt,len(txt)-1)
txt = replace(txt , "@" , " + ")
activecell.value = txt
End Sub
Bonjour à toutes et tous J'ai un userform avec ce code : Je souhaite que si l'utilisateur coche par exemple le checkbox1 et le 3 dans la cellule active, il y a : alpha + charly merci et bonne soirée Michel
Private Sub CommandButton1_Click() If CheckBox1 Then ActiveCell.Value = "alpha" End If If CheckBox2 Then ActiveCell.Value = "bêta" End If If CheckBox3 Then ActiveCell.Value = "charly" End If If CheckBox4 Then ActiveCell.Value = "echo" End If End Sub
Bonsoir,
Non testé :
Private Sub CommandButton1_Click() txt = "" If CheckBox1 Then txt = txt & "@alpha" End If If CheckBox2 Then txt = txt & "@bêta" End If If CheckBox3 Then txt = txt &"@charly" End If If CheckBox4 Then txt = txt & "@echo" End If if left(txt,1)="@" then txt = right(txt,len(txt)-1) txt = replace(txt , "@" , " + ") activecell.value = txt End Sub
For i = 0 To Me.Controls.Count - 1 If TypeName(Controls(i)) = "CheckBox" And Controls(i) = True Then ActiveCell = ActiveCell & " " & MonTableau(i) End If Next
End Sub
amicalement
-----Original Message----- Bonjour à toutes et tous J'ai un userform avec ce code : Je souhaite que si l'utilisateur coche par exemple le checkbox1 et le 3
dans la cellule active, il y a : alpha + charly merci et bonne soirée Michel
Private Sub CommandButton1_Click() If CheckBox1 Then ActiveCell.Value = "alpha" End If If CheckBox2 Then ActiveCell.Value = "bêta" End If If CheckBox3 Then ActiveCell.Value = "charly" End If If CheckBox4 Then ActiveCell.Value = "echo" End If End Sub
For i = 0 To Me.Controls.Count - 1
If TypeName(Controls(i)) = "CheckBox" And Controls(i)
= True Then
ActiveCell = ActiveCell & " " & MonTableau(i)
End If
Next
End Sub
amicalement
-----Original Message-----
Bonjour à toutes et tous
J'ai un userform avec ce code :
Je souhaite que si l'utilisateur coche par exemple le
checkbox1 et le 3
dans la cellule active, il y a : alpha + charly
merci et bonne soirée
Michel
Private Sub CommandButton1_Click()
If CheckBox1 Then
ActiveCell.Value = "alpha"
End If
If CheckBox2 Then
ActiveCell.Value = "bêta"
End If
If CheckBox3 Then
ActiveCell.Value = "charly"
End If
If CheckBox4 Then
ActiveCell.Value = "echo"
End If
End Sub
For i = 0 To Me.Controls.Count - 1 If TypeName(Controls(i)) = "CheckBox" And Controls(i) = True Then ActiveCell = ActiveCell & " " & MonTableau(i) End If Next
End Sub
amicalement
-----Original Message----- Bonjour à toutes et tous J'ai un userform avec ce code : Je souhaite que si l'utilisateur coche par exemple le checkbox1 et le 3
dans la cellule active, il y a : alpha + charly merci et bonne soirée Michel
Private Sub CommandButton1_Click() If CheckBox1 Then ActiveCell.Value = "alpha" End If If CheckBox2 Then ActiveCell.Value = "bêta" End If If CheckBox3 Then ActiveCell.Value = "charly" End If If CheckBox4 Then ActiveCell.Value = "echo" End If End Sub
.
verificator
Michel,
damned, j'ai oublié le "+" ---------------------------------------------------- Private Sub CommandButton1_Click() ActiveCell = "" MonTableau = Array("alpha", "bêta", "charly", "echo")
For i = 0 To Me.Controls.Count - 1 If TypeName(Controls(i)) = "CheckBox" And Controls(i) = True Then ActiveCell = ActiveCell & MonTableau(i) & " + " End If Next If Len(ActiveCell) > 0 Then ActiveCell = Mid(ActiveCell, 1, Len(ActiveCell) - 2) End If End Sub ----------------------------------------------------
For i = 0 To Me.Controls.Count - 1 If TypeName(Controls(i)) = "CheckBox" And Controls (i)
= True Then ActiveCell = ActiveCell & " " & MonTableau(i) End If Next
End Sub
amicalement
-----Original Message----- Bonjour à toutes et tous J'ai un userform avec ce code : Je souhaite que si l'utilisateur coche par exemple le checkbox1 et le 3
dans la cellule active, il y a : alpha + charly merci et bonne soirée Michel
Private Sub CommandButton1_Click() If CheckBox1 Then ActiveCell.Value = "alpha" End If If CheckBox2 Then ActiveCell.Value = "bêta" End If If CheckBox3 Then ActiveCell.Value = "charly" End If If CheckBox4 Then ActiveCell.Value = "echo" End If End Sub
.
.
Michel,
damned, j'ai oublié le "+"
----------------------------------------------------
Private Sub CommandButton1_Click()
ActiveCell = ""
MonTableau = Array("alpha", "bêta", "charly", "echo")
For i = 0 To Me.Controls.Count - 1
If TypeName(Controls(i)) = "CheckBox" And Controls(i)
= True Then
ActiveCell = ActiveCell & MonTableau(i) & " + "
End If
Next
If Len(ActiveCell) > 0 Then
ActiveCell = Mid(ActiveCell, 1, Len(ActiveCell) - 2)
End If
End Sub
----------------------------------------------------
For i = 0 To Me.Controls.Count - 1
If TypeName(Controls(i)) = "CheckBox" And Controls
(i)
= True Then
ActiveCell = ActiveCell & " " & MonTableau(i)
End If
Next
End Sub
amicalement
-----Original Message-----
Bonjour à toutes et tous
J'ai un userform avec ce code :
Je souhaite que si l'utilisateur coche par exemple le
checkbox1 et le 3
dans la cellule active, il y a : alpha + charly
merci et bonne soirée
Michel
Private Sub CommandButton1_Click()
If CheckBox1 Then
ActiveCell.Value = "alpha"
End If
If CheckBox2 Then
ActiveCell.Value = "bêta"
End If
If CheckBox3 Then
ActiveCell.Value = "charly"
End If
If CheckBox4 Then
ActiveCell.Value = "echo"
End If
End Sub
damned, j'ai oublié le "+" ---------------------------------------------------- Private Sub CommandButton1_Click() ActiveCell = "" MonTableau = Array("alpha", "bêta", "charly", "echo")
For i = 0 To Me.Controls.Count - 1 If TypeName(Controls(i)) = "CheckBox" And Controls(i) = True Then ActiveCell = ActiveCell & MonTableau(i) & " + " End If Next If Len(ActiveCell) > 0 Then ActiveCell = Mid(ActiveCell, 1, Len(ActiveCell) - 2) End If End Sub ----------------------------------------------------
For i = 0 To Me.Controls.Count - 1 If TypeName(Controls(i)) = "CheckBox" And Controls (i)
= True Then ActiveCell = ActiveCell & " " & MonTableau(i) End If Next
End Sub
amicalement
-----Original Message----- Bonjour à toutes et tous J'ai un userform avec ce code : Je souhaite que si l'utilisateur coche par exemple le checkbox1 et le 3
dans la cellule active, il y a : alpha + charly merci et bonne soirée Michel
Private Sub CommandButton1_Click() If CheckBox1 Then ActiveCell.Value = "alpha" End If If CheckBox2 Then ActiveCell.Value = "bêta" End If If CheckBox3 Then ActiveCell.Value = "charly" End If If CheckBox4 Then ActiveCell.Value = "echo" End If End Sub
.
.
FxM
au port, au port, vite dit ... 'suis pas Marseillais, moi :o)
@+ FxM
Michel,
damned, j'ai oublié le "+" ---------------------------------------------------- Private Sub CommandButton1_Click() ActiveCell = "" MonTableau = Array("alpha", "bêta", "charly", "echo")
For i = 0 To Me.Controls.Count - 1 If TypeName(Controls(i)) = "CheckBox" And Controls(i) = True Then ActiveCell = ActiveCell & MonTableau(i) & " + " End If Next If Len(ActiveCell) > 0 Then ActiveCell = Mid(ActiveCell, 1, Len(ActiveCell) - 2) End If End Sub ----------------------------------------------------
je corrige because FXM est déjà rentré au port
amicalement
au port, au port, vite dit ... 'suis pas Marseillais, moi :o)
@+
FxM
Michel,
damned, j'ai oublié le "+"
----------------------------------------------------
Private Sub CommandButton1_Click()
ActiveCell = ""
MonTableau = Array("alpha", "bêta", "charly", "echo")
For i = 0 To Me.Controls.Count - 1
If TypeName(Controls(i)) = "CheckBox" And Controls(i)
= True Then
ActiveCell = ActiveCell & MonTableau(i) & " + "
End If
Next
If Len(ActiveCell) > 0 Then
ActiveCell = Mid(ActiveCell, 1, Len(ActiveCell) - 2)
End If
End Sub
----------------------------------------------------
au port, au port, vite dit ... 'suis pas Marseillais, moi :o)
@+ FxM
Michel,
damned, j'ai oublié le "+" ---------------------------------------------------- Private Sub CommandButton1_Click() ActiveCell = "" MonTableau = Array("alpha", "bêta", "charly", "echo")
For i = 0 To Me.Controls.Count - 1 If TypeName(Controls(i)) = "CheckBox" And Controls(i) = True Then ActiveCell = ActiveCell & MonTableau(i) & " + " End If Next If Len(ActiveCell) > 0 Then ActiveCell = Mid(ActiveCell, 1, Len(ActiveCell) - 2) End If End Sub ----------------------------------------------------
je corrige because FXM est déjà rentré au port
amicalement
Michel
Merci à tous les deux impecc ! Michel
"FxM" a écrit dans le message de news:
au port, au port, vite dit ... 'suis pas Marseillais, moi :o)
@+ FxM
Michel,
damned, j'ai oublié le "+" ---------------------------------------------------- Private Sub CommandButton1_Click() ActiveCell = "" MonTableau = Array("alpha", "bêta", "charly", "echo")
For i = 0 To Me.Controls.Count - 1 If TypeName(Controls(i)) = "CheckBox" And Controls(i) = True Then ActiveCell = ActiveCell & MonTableau(i) & " + " End If Next If Len(ActiveCell) > 0 Then ActiveCell = Mid(ActiveCell, 1, Len(ActiveCell) - 2) End If End Sub ----------------------------------------------------
je corrige because FXM est déjà rentré au port
amicalement
Merci à tous les deux impecc !
Michel
"FxM" <nullos@greuchmeu.ici> a écrit dans le message de news:
eJ8jkye8EHA.3336@TK2MSFTNGP11.phx.gbl...
au port, au port, vite dit ... 'suis pas Marseillais, moi :o)
@+
FxM
Michel,
damned, j'ai oublié le "+"
----------------------------------------------------
Private Sub CommandButton1_Click()
ActiveCell = ""
MonTableau = Array("alpha", "bêta", "charly", "echo")
For i = 0 To Me.Controls.Count - 1
If TypeName(Controls(i)) = "CheckBox" And Controls(i) = True Then
ActiveCell = ActiveCell & MonTableau(i) & " + "
End If
Next
If Len(ActiveCell) > 0 Then
ActiveCell = Mid(ActiveCell, 1, Len(ActiveCell) - 2)
End If
End Sub
----------------------------------------------------
au port, au port, vite dit ... 'suis pas Marseillais, moi :o)
@+ FxM
Michel,
damned, j'ai oublié le "+" ---------------------------------------------------- Private Sub CommandButton1_Click() ActiveCell = "" MonTableau = Array("alpha", "bêta", "charly", "echo")
For i = 0 To Me.Controls.Count - 1 If TypeName(Controls(i)) = "CheckBox" And Controls(i) = True Then ActiveCell = ActiveCell & MonTableau(i) & " + " End If Next If Len(ActiveCell) > 0 Then ActiveCell = Mid(ActiveCell, 1, Len(ActiveCell) - 2) End If End Sub ----------------------------------------------------