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