
valo = InputBox("Cerca in cartella di lavoro:")
If valo <> "" Then
For Each sh In Worksheets
If InStr(1, sh.Name, valo, vbTextCompare) > 0 Then
sh.Select
MsgBox "Il valore è stato trovato nell'etichetta del foglio."
Exit Sub
End If
Set fin = sh.Range("a:b").Find(What:=valo, LookAt:=xlPart, MatchCase:=False)
If Not fin Is Nothing Then
sh.Select
fin.Select
MsgBox "Il valore è stato trovato all'interno del foglio."
Exit Sub
End If
Next
End If |
valo = InputBox("Cerca in cartella di lavoro:")
If valo <> "" Then
For Each sh In Worksheets
If InStr(1, sh.Name, valo, vbTextCompare) > 0 Then
sh.Select
MsgBox "Il valore è stato trovato nell'etichetta del foglio."
Exit Sub
End If
Set fin = sh.Range("a:b").Find(What:=valo, LookAt:=xlPart, MatchCase:=False)
If Not fin Is Nothing Then
Do
sh.Select
fin.Select
If MsgBox("Valore trovato all'interno del foglio." & vbCrLf & "Continuare la ricerca?", vbYesNo) = vbNo Then
Exit Sub
End If
Set fin = sh.Range("a:b").FindNext(fin)
Loop
Exit Sub
End If
Next
MsgBox "Valore non trovato."
End If |
valo = InputBox("Cerca in cartella di lavoro:")
If valo <> "" Then
For Each sh In Worksheets
If InStr(1, sh.Name, valo, vbTextCompare) > 0 Then
sh.Select
cont = True
If MsgBox("Il valore è stato trovato nell'etichetta del foglio." & vbCrLf & "Continuare la ricerca?", vbYesNo) = vbNo Then
Exit Sub
End If
End If
Set fin = sh.Range("a:b").Find(what:=valo, lookat:=xlPart, MatchCase:=False)
If Not fin Is Nothing Then
firstaddress = fin.Address
cont = True
Do
sh.Select
fin.Select
If MsgBox("Valore trovato all'interno del foglio." & vbCrLf & "Continuare la ricerca?", vbYesNo) = vbNo Then
Exit Sub
End If
Set fin = sh.Range("a:b").FindNext(fin)
Loop While Not fin Is Nothing And fin.Address <> firstaddress
End If
Next
If cont = True Then
MsgBox "Ricerca terminata."
Else
MsgBox "Valore non trovato."
End If
End If |
