Private Sub CommandButton1_Click() Dim i as Integer For i = 1 To 5 Me.Controls("TextBox" & i).Value = "" Next i End Sub
Private Sub PUL_CAMPI_Click() Dim ctrl As Control For Each ctrl In Me.Controls If TypeName(ctrl) = "TextBox" Or TypeName(ctrl) = "ComboBox" Then ctrl.Value = "" End If Next ctrl End Sub
Private Sub INSERISCI_Click() Dim emptyRow As Long Dim d As Date Dim s As String Dim ctrl As Control s = NomeTextBox & " " & CognomeTextBox With Me d = .ComboBox1.Text & "/" & _ .ComboBox2.Text & "/" & _ .ComboBox3.Text End With Sheets("Riepilogo").Select 'Determine emptyRow emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1 'Transfer information Cells(emptyRow, 1).Value = s Cells(emptyRow, 2).Value = CommessaComboBox.Value Cells(emptyRow, 3).Value = d Cells(emptyRow, 4).Value = OreLavorateTextBox.Value For Each ctrl In Me.Controls If TypeName(ctrl) = "TextBox" Or TypeName(ctrl) = "ComboBox" Then ctrl.Value = "" End If Next ctrl End Sub