With ActiveSheet.Range("B3:B150")
Dim x As String
x = TextBox1.Value
Set C = .Find(x, LookIn:=xlValues) ', LookAt:=xlWhole
If Not C Is Nothing Then
firstAddress = C.Address
Do
C.Cells.Select
TextBox2 = C.Value
TextBox3 = C.Offset(0, 1).Value
TextBox4 = C.Offset(0, 2).Value
TextBox5 = C.Offset(0, 3).Value
TextBox6 = C.Offset(0, 4).Value
TextBox7 = C.Offset(0, 5).Value
Y = C.Value
irisposta = MsgBox("Trovato " & Y & " . Vuoi fermarti ?", vbYesNo)
If irisposta = vbYes Then 'se rispondo si allora
GoTo 10 'esco dal ciclo
End If
Set C = .FindNext(C)
Loop While Not C Is Nothing And C.Address <> firstAddress
Else
MsgBox "Nome non Trovato"
End If
10:
End With
End If
Private Sub CommandButton5_Click()
Dim sh1 As Worksheet: Set sh1 = Worksheets("Data Base")
Dim beta, delta, teta, lamda
beta = UserForm1.ComboBox1.Text
delta = UserForm1.ComboBox2.Text
teta = UserForm1.ComboBox3.Text
lamda = UserForm1.ComboBox4.Text
Sheets("Ricerca").Range("A1").Value = beta
Range("A1").Select
Selection.AutoFilter
sh1.Range("$A$1:$E$177").AutoFilter Field:=1, Criteria1:=beta
sh1.Range("$A$1:$E$177").AutoFilter Field:=2, Criteria1:=delta
sh1.Range("$A$1:$E$177").AutoFilter Field:=3, Criteria1:=teta
sh1.Range("$A$1:$E$177").AutoFilter Field:=4, Criteria1:=lamda
Sheets("Data Base").Select
Range("A1").Offset(1, 0).Select
TextBox9 = ActiveCell.Value
TextBox10 = ActiveCell.Offset(0, 1).Value
TextBox11 = ActiveCell.Offset(0, 2).Value
TextBox12 = ActiveCell.Offset(0, 3).Value
TextBox13 = ActiveCell.Offset(0, 4).Value
TextBox5 = ActiveCell.Offset(0, 5).Value
TextBox6 = ActiveCell.Offset(0, 6).Value
TextBox7 = ActiveCell.Offset(0, 7).Value
TextBox8 = ActiveCell.Offset(0, 8).Value
TextBox3 = ActiveCell.Offset(0, 9).Value
TextBox4 = ActiveCell.Offset(0, 10).Value
End Sub |