
Private Sub CommandButton1_Click() If Cells(34, 5) = "Nessuna Segnalazione" Then MsgBox "Hai impostato Nessuna Segnalazione" else Cells(34, 5) = "Segnalazione RLS" Then MsgBox "Hai impostato Segnalazione RLS" else Cells(34, 5) = "Prescrizione ASL" Then MsgBox "Hai impostato Prescrizione ASL" End If Else MsgBox "EFFETTUA UNA SCELTA" End If End If End If Richiesta_Priorità.Hide Unload Richiesta_Priorità End Sub Private Sub OptionButton1_Click() Cells(34, 5).Value = "Prescrizione ASL" End Sub Private Sub OptionButton2_Click() Cells(34, 5).Value = "Segnalazione RLS" End Sub Private Sub OptionButton3_Click() Cells(34, 5).Value = "Nessuna Segnalazione" End Sub Private Sub UserForm_Click() End Sub |
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If IsNumeric(TextBox1) = False Then 'se il valore non è un numero
MsgBox "Inserire Numeri" 'avvisiamo con un messaggio
Cancel = True 'impediamo l'uscita dalla textbox
TextBox1.SelStart = 0 'impostiamo il punto iniziale del valore da selezionare
Else
TextBox1.SelLength = Len(TextBox1)
End If
Unload.me
End Sub |
Sub Scelta() If UserForm1.OptionButton1 = True Then UserForm1.TextBox1.Text = "Prescrizione ASL" If UserForm1.OptionButton2 = True Then UserForm1.TextBox1.Text = "Segnalazione RLS" If UserForm1.OptionButton3 = True Then UserForm1.TextBox1.Text = "Nessuna Segnalazione" ActiveSheet.Cells(34, 5) = UserForm1.TextBox1.Text Unload UserForm1 End Sub |
