Ceci est une page optimisée pour les mobiles. Cliquez sur ce texte pour afficher la vraie page.

Comment assemblés 3 boutons de macros en un seul ???

Guido

XLDnaute Accro
Bonsoir le Forum

Sur ma page A de mon fichier..

Jai 3 boutons de macros comment faire l'exécutions des 3 macros ou boutons en un seul bouton.

ah, oui , je doit appuyé deux fois un boutons de macros pour exécuter une macros ,comment

rédiger en VBA le texte afin d'appuyé une seule fois le bouton afin de résoudre cette macros.,

Merci d'avance

Guido
 

Lone-wolf

XLDnaute Barbatruc
Bonsoir Guido

Private Sub CommandButton1_Click()
Code du bouton 1

CommandButton2_Click
CommandButton3_Click
end Sub

Classeur démo en PJ
 

Pièces jointes

  • Classeur1.xlsm
    20.6 KB · Affichages: 31
Dernière édition:

Lone-wolf

XLDnaute Barbatruc
Bonjour Guido

VB:
Private Sub CommandButton1_Click()
Dim lig As Long
CommandButton1.Enabled = False
lig = Range("c" & Rows.Count).End(xlUp).Row + 1
Range("c" & lig) = "x"
If Range("c" & lig) <> "" Then
CommandButton1.Enabled = True
Else
Exit Sub
End If
CommandButton2_Click
CommandButton3_Click
End Sub

Private Sub CommandButton2_Click()
MsgBox "Bonsoir !"
End Sub

Private Sub CommandButton3_Click()
MsgBox "Bonne nuit !"
End Sub

Autre exemple
VB:
Private Sub CommandButton1_Click()
Dim lig As Long
lig = Range("c" & Rows.Count).End(xlUp).Row + 1

Select Case Range("c" & lig)
Case Is = ""
CommandButton1.Enabled = False
CommandButton2_Click
CommandButton3_Click
Range("c" & lig) = "x"
End Select
CommandButton1.Enabled = True
End Sub
 
Dernière édition:

Discussions similaires

Les cookies sont requis pour utiliser ce site. Vous devez les accepter pour continuer à utiliser le site. En savoir plus…