Pagina precedente | 1 | Pagina successiva
Vota | Stampa | Notifica email    
Autore

codice all'incontrario

Ultimo Aggiornamento: 16/08/2017 17:46
Post: 140
Registrato il: 02/04/2010
Città: MILANO
Età: 54
Utente Junior
2002
OFFLINE
15/08/2017 18:09

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
Post: 3.931
Registrato il: 13/03/2012
Città: LIVORNO
Età: 78
Utente Master
2010
OFFLINE
16/08/2017 07:36

stai facendo crossposting e non è molto gradito, comunque ti ho risposto qui http://www.excelvba.it/Forum/thread.php?f=1&t=12229

----------
Win 10 - Excel 2010
allega un file di esempio, guadagnerai tempo tu e lo farai risparmiare a chi ti aiuta
Post: 1.546
Registrato il: 06/04/2013
Utente Veteran
2010
OFFLINE
16/08/2017 17:46

...e pure qui:

http://forum.ialweb.it/forum_posts.asp?TID=16467034&title=tasto-indietro

saluti





Domenico
Win 10 - Excel 2016
Vota:
Amministra Discussione: | Chiudi | Sposta | Cancella | Modifica | Notifica email Pagina precedente | 1 | Pagina successiva
Nuova Discussione
 | 
Rispondi
Cerca nel forum
Tag discussione
Discussioni Simili   [vedi tutte]
Feed | Forum | Bacheca | Album | Utenti | Cerca | Login | Registrati | Amministra
Tutti gli orari sono GMT+01:00. Adesso sono le 16:25. Versione: Stampabile | Mobile | Regolamento | Privacy
FreeForumZone [v.6.1] - Copyright © 2000-2024 FFZ srl - www.freeforumzone.com