salve, a un tasto "cerca" di una form ho questo codice collegato
Private Sub CommandButton1_Click()
Dim i As Long
RAvvia:
userform1.Caption = "CERCA in cella"
TextBox1.SetFocus
TextBox1.SelStart = 0
TextBox1.SelLength = Len(TextBox1.Text)
With ActiveSheet.Range("X2:AB65536, A2:d65536, e1:j65536")
If CheckBox2.Value = True Then lAt = 1 Else lAt = 2
If myPrimo Is Nothing Then
myK1 = 0
Set c = .Find(TextBox1.Text, LookIn:=xlValues, lookat:=lAt)
Else: Set c = .FindNext(myCorr)
End If
If c Is Nothing Then GoTo CkCmt
If Not myPrimo Is Nothing Then If c.Address = myPrimo.Address Then GoTo CkCmt
c.Select
If myPrimo Is Nothing Then Set myPrimo = c
Set myCorr = c: userform1.Caption = "TROVATO in cella"
End With
Exit Sub
CkCmt:
userform1.Caption = "CERCA in commento"
If myPrimo Is Nothing Then Set myPrimo = ActiveCell
If myCorr Is Nothing Then Set myCorr = ActiveCell
For i = myK1 + 1 To ActiveSheet.Comments.Count
Set Kmt = ActiveSheet.Comments(i)
If Not Application.Intersect(Kmt.Parent, Range("X2:AB65536, A2:B65536, e1:j65536")) Is Nothing Then
myFlag = 0
If CheckBox2.Value = True And UCase(Kmt.Text) = UCase(TextBox1.Text) Then myFlag = True
If CheckBox2.Value = False And Len(UCase(Kmt.Text)) > Len(Replace(UCase(Kmt.Text), UCase(TextBox1.Text), "")) Then myFlag = True
If myFlag = True Then
myK1 = i: Kmt.Parent.Select
userform1.Caption = "TROVATO in commento": Exit Sub
End If
End If
Next
FineKmt:
userform1.Caption = "------> FINE RICERCA"
Set myPrimo = Nothing
End Sub
che praticamente cerca dei nominativi...vorrei creare un altro tasto nella from che se in caso per la fretta supero il nome cercato e mi va al successivo perchè c'è un atro nome uguale, mi da la possibilità di tornare indietro di uno ogni volta che clicco il tasto chiamiamolo "indietro"
grazie
excel 2003