Option Explicit
Sub cerca()
Dim inpt As String
inpt = Application.InputBox("Inserisci nr assegno", Type:=2)
If Len(inpt) <> 10 Then
MsgBox "Numero non valido, inserire 10 cifre."
GoTo Uscita
End If
'col = InputBox("Inserisci colonna") 'utilità di questa riga?
'Range(col & 1).Select 'utilità di questa riga?
With Columns("f:F")
Set c = .Find(inpt, LookIn:=xlValues)
x = 1
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Select
MsgBox ("trovato" & x)
Set c = .FindNext(c)
x = x + 1
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
Uscita:
End Sub |