Recherche dans un classeur en VBA Excel
Lastfall
-
m.delpiero -
m.delpiero -
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-
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:
- Recherche dans un classeur en VBA Excel
- Liste déroulante excel - Guide
- Mise en forme conditionnelle excel - Guide
- Word et excel gratuit - Guide
- Recherche automatique des chaînes ne fonctionne pas - Guide
- Trier un tableau excel - Guide