Recherche dans un classeur en VBA Excel

Fermé
Lastfall - 27 mars 2008 à 01:43
 m.delpiero - 27 mai 2008 à 17:42
Bonjour,
j'ai un problème de prog. je ne suis pas vraiment bon en prog.

je veux apartir d'un bouton sur un formulaire rechercher un valeur (dans tout le classeur) d'un textbox sur le meme formulaire.
mon code qui ne fonctionne pas est ca me donne erreur d'exécution 9 ( l'indice n'appartient pas à la sélection):

Private Sub btnrecherche_Click()

Dim vdatedebut As String
Dim vdatefin As String
Dim refdate As Object
Dim Sht As Worksheet

vdatedebut = txtdebut.Text
vdatefin = txtfin.Text

For Each Sht In ActiveWorkbook.Worksheets
Set rngFind = Sht.Cells.Find(What:=vdatedebut, After:=ActiveCell, LookIn:=xlValue, LookAt _
:=xlWithinWorkbook, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
True, SearchFormat:=False).Activate
If Not rngFind Is Nothing Then
ActiveCell.Select
End If

Next Sht

End Sub


merci beaucoup

-phil-
A voir également:

1 réponse

salut lastfall

est ce que tu as trouvé une solution à ton problème parce que j'ai le meme !!!!!
donc si tu peux m'aider ,ca serait bien merci
0