|
|
|
 |
Título da Dica: Realiza busca por strings nas células o excel, depois verifica toda a planilha, até o final.....
|
 |
|
|
Postada em 16/2/2006 por Geronimo
PROCURAR POR STRINGS NO EXCEL... E PESQUISAR PELA PRÓXIMA...
IMPORTANTE: É NECESSÁRIO DECLARAR AS VARIÁVEIS DE CONTROLE COMO PUBLIC....
If TextBox1.text = "" Then MsgBox "Digite uma referência a ser buscada!" Exit Sub End If
ActiveCell.Select Maxplace = Selection.address ActiveSheet.Range(Maxplace, Cells(200, 2)).Select Selection.Find(what:=(TextBox1.text), AFTER:=ActiveCell, LookIn:=xlValues, _ LookAt:=xlPart, searchOrder:=xlByColumns, searchDirection:=xlNext, _ MatchCase:=False).Select
ulttext = Selection.address text = TextBox1.text
If Maxplace = ulttext Then cont = cont + 1 If cont = 3 Then If MsgBox("A pesquisa chegou ao final da planilha e não encontrou mais dados, deseja pesquisar do início?", vbYesNo, "Pesquisar Novamente!") = vbYes Then Maxplace = Range("b8").Select cont = 0 Else cont = 0 End If End If Else cont = 0 End If
End If
|
|
|
|

|