Stellar Blade Un'esclusiva PS5 che sta facendo discutere per l'eccessiva bellezza della protagonista. Vieni a parlarne su Award & Oscar!
 
Pagina precedente | 1 | Pagina successiva
Vota | Stampa | Notifica email    
Autore

modifica combobox per scelta

Ultimo Aggiornamento: 01/07/2022 15:18
Post: 450
Registrato il: 28/05/2011
Città: MILANO
Età: 43
Utente Senior
excel 2000/2007
OFFLINE
29/06/2022 08:27

Ciao a tutti,
in questo codice della combobox allegata è possibile aggiungere:
se scelgo archiva1 fai partire la macro archivia1
se scelgo archiva2 fai partire la macro archivia2

Option Explicit

Private Sub cmdCancel_Click()
'Unload the userform
    Unload Me
End Sub

Private Sub cmdOkay_Click()
'Verify that an item was selected
    If Me.ComboBox1.BoundValue = vbNullString Then
        MsgBox "You did not choose an item!", vbOKOnly
    Else
        MsgBox "You choose " & Me.ComboBox1.BoundValue, vbOKOnly
    End If
    Unload Me
End Sub

Private Sub UserForm_Initialize()
'Load the combobox with a variety of household pets
    With Me.ComboBox1
        .AddItem ("archivia1")
        .AddItem ("archivia2")
    End With
End Sub


Grazie in anticipo
[Modificato da john_cash 29/06/2022 08:29]
---------------
excel 2007
Post: 1.213
Registrato il: 16/08/2015
Città: CORDENONS
Età: 67
Utente Veteran
Excel 2016-32bit Win11
OFFLINE
30/06/2022 23:10

Ti potrebbe bastare questa modifica alla macro:
Private Sub cmdOkay_Click()
    'Verify that an item was selected
    If Me.ComboBox1.BoundValue = vbNullString Then
        MsgBox "You did not choose an item!", vbOKOnly
    Else
        MsgBox "You choose " & Me.ComboBox1.BoundValue, vbOKOnly
        If ComboBox1.Text = "archivia1" Then
            Call Archivia1
        ElseIf ComboBox1.Text = "archivia2" Then
            Call Archivia2
        Else
            MsgBox "Non hai inserito un richiamo valido!"
        End If
    End If
    Unload Me
End Sub

______________________________________________________________
C'è chi fa le COSE a CASO e chi fa CASO alle COSE (Ignoto)
Post: 452
Registrato il: 28/05/2011
Città: MILANO
Età: 43
Utente Senior
excel 2000/2007
OFFLINE
01/07/2022 12:58

Ciao rollis13,
è o.k.
john
---------------
excel 2007
Post: 1.214
Registrato il: 16/08/2015
Città: CORDENONS
Età: 67
Utente Veteran
Excel 2016-32bit Win11
OFFLINE
01/07/2022 15:18

Certo che è okay 😁😂.

______________________________________________________________
C'è chi fa le COSE a CASO e chi fa CASO alle COSE (Ignoto)
Vota:
Amministra Discussione: | Chiudi | Sposta | Cancella | Modifica | Notifica email Pagina precedente | 1 | Pagina successiva
Nuova Discussione
 | 
Rispondi
Cerca nel forum
Tag discussione
Discussioni Simili   [vedi tutte]
Feed | Forum | Bacheca | Album | Utenti | Cerca | Login | Registrati | Amministra
Tutti gli orari sono GMT+01:00. Adesso sono le 21:11. Versione: Stampabile | Mobile | Regolamento | Privacy
FreeForumZone [v.6.1] - Copyright © 2000-2024 FFZ srl - www.freeforumzone.com