Probleme avec la fonction recherche
Résolu/Fermé
aurelie76
Messages postés
88
Date d'inscription
samedi 19 avril 2008
Statut
Membre
Dernière intervention
13 mai 2017
-
1 juil. 2014 à 00:18
skk201 Messages postés 938 Date d'inscription jeudi 11 septembre 2008 Statut Membre Dernière intervention 16 octobre 2016 - 2 juil. 2014 à 08:45
skk201 Messages postés 938 Date d'inscription jeudi 11 septembre 2008 Statut Membre Dernière intervention 16 octobre 2016 - 2 juil. 2014 à 08:45
A voir également:
- Probleme avec la fonction recherche
- Fonction si et - Guide
- Recherche musique - Guide
- Google recherche par image - Guide
- Recherche automatique des chaînes ne fonctionne pas - Guide
- Recherche adresse - Guide
2 réponses
skk201
Messages postés
938
Date d'inscription
jeudi 11 septembre 2008
Statut
Membre
Dernière intervention
16 octobre 2016
54
1 juil. 2014 à 15:53
1 juil. 2014 à 15:53
Bonjour,
ça serai simpa de nous transmettre ton code et de nous indiquer quelle ligne cause l'erreur 91.
Merci
ça serai simpa de nous transmettre ton code et de nous indiquer quelle ligne cause l'erreur 91.
Merci
aurelie76
Messages postés
88
Date d'inscription
samedi 19 avril 2008
Statut
Membre
Dernière intervention
13 mai 2017
3
1 juil. 2014 à 22:06
1 juil. 2014 à 22:06
bonsoir, j'ai un ctrl C + V, désolé pour les balises, ce bout de programme foncttionne mais quand je l'appelle via un call techno, ca ne marche plus. Peut-être faut-il initialiser les différentes variables, je sèche, merci pour ton aide, aurelie76
Sub techno()
Dim fin_line As Integer
Dim Mnemo As Integer
Dim tech As String
Workbooks.Open Filename:= _
"C:\Users\\Documents\Projet \source\techno.xls"
Workbooks.Open Filename:= _
"C:\Users\\Documents\Projet\source\ini_of.xls"
Windows("ini_of.xls").Activate
fin_line = Range("A" & Rows.Count).End(xlUp).Row
For Mnemo = fin_line To 2 Step -1
tech = Cells(Mnemo, 4).Value
Windows("techno.xls").Activate
Selection.Find(What:=tech, After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=True).Activate
' si pas trouvé dans le feuille
ActiveCell.Select
' MsgBox Err.Number
If (Err.Number > 0) Then
Windows("ini_of.xls").Activate
Sheets(1).Select
Else
' si trouvé dans le feuille
ActiveCell.Offset(0, 1).Select
tech = ActiveCell.Value
Windows("ini_of.xls").Activate
Cells(Mnemo, 5).Value = tech
End If
Next Mnemo
End Sub
Sub techno()
Dim fin_line As Integer
Dim Mnemo As Integer
Dim tech As String
Workbooks.Open Filename:= _
"C:\Users\\Documents\Projet \source\techno.xls"
Workbooks.Open Filename:= _
"C:\Users\\Documents\Projet\source\ini_of.xls"
Windows("ini_of.xls").Activate
fin_line = Range("A" & Rows.Count).End(xlUp).Row
For Mnemo = fin_line To 2 Step -1
tech = Cells(Mnemo, 4).Value
Windows("techno.xls").Activate
Selection.Find(What:=tech, After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=True).Activate
' si pas trouvé dans le feuille
ActiveCell.Select
' MsgBox Err.Number
If (Err.Number > 0) Then
Windows("ini_of.xls").Activate
Sheets(1).Select
Else
' si trouvé dans le feuille
ActiveCell.Offset(0, 1).Select
tech = ActiveCell.Value
Windows("ini_of.xls").Activate
Cells(Mnemo, 5).Value = tech
End If
Next Mnemo
End Sub
skk201
Messages postés
938
Date d'inscription
jeudi 11 septembre 2008
Statut
Membre
Dernière intervention
16 octobre 2016
54
2 juil. 2014 à 08:45
2 juil. 2014 à 08:45
Si jamais tu peux faire apparaitre le texte en format Visual Basic avec la balise de code <'code basic> Text <'/code>
Concernant ton problème voici ce que le support microsoft nous dit : https://support.microsoft.com/fr-fr/help/462012
Le problème vient apparemment que le fonction recherche ne trouve pas de résultat donc rien à voir avec la fonction call ?
Je te laisse regardé :)
Concernant ton problème voici ce que le support microsoft nous dit : https://support.microsoft.com/fr-fr/help/462012
Le problème vient apparemment que le fonction recherche ne trouve pas de résultat donc rien à voir avec la fonction call ?
Je te laisse regardé :)