J
Jon
Guest
Hello,
J'ai un petit problème avec ma macro!
J'ai une base de données avec la colonne A (no d'articles) et la colonne B (nom d'articles)
Exemple :
1 balle
2 balle 2
3 balle 3
Voici ma macro:
Option Explicit
Sub RechercheCible()
Dim Plage As Range
Dim Adresse As String
Dim C As Object
Dim Mot As String
Dim TheRow As Integer
Mot = InputBox("Numéro à chercher ?")
'Contrôles avant recherche
If Mot = "" Then Exit Sub
If Application.CountIf(Range("A:B"), Mot) = 0 Then MsgBox "Ce mot est inexistant !": Exit Sub
'Recherche du N°
Set Plage = Sheets("Accueil").Range("A:B")
With Plage
Set C = .Find(Mot)
If Not C Is Nothing Then
Adresse = C.Address
TheRow = C.Row
'Transport à la ligne du mot recherché
ActiveWindow.ScrollRow = TheRow
C.EntireRow.Range("A1:B1").Select
End If
End With
End Sub
J'aimerais pouvoir passé au suivant lorsque je tape par exemple que "balle"!!
Merci pour votre aide
J'ai un petit problème avec ma macro!
J'ai une base de données avec la colonne A (no d'articles) et la colonne B (nom d'articles)
Exemple :
1 balle
2 balle 2
3 balle 3
Voici ma macro:
Option Explicit
Sub RechercheCible()
Dim Plage As Range
Dim Adresse As String
Dim C As Object
Dim Mot As String
Dim TheRow As Integer
Mot = InputBox("Numéro à chercher ?")
'Contrôles avant recherche
If Mot = "" Then Exit Sub
If Application.CountIf(Range("A:B"), Mot) = 0 Then MsgBox "Ce mot est inexistant !": Exit Sub
'Recherche du N°
Set Plage = Sheets("Accueil").Range("A:B")
With Plage
Set C = .Find(Mot)
If Not C Is Nothing Then
Adresse = C.Address
TheRow = C.Row
'Transport à la ligne du mot recherché
ActiveWindow.ScrollRow = TheRow
C.EntireRow.Range("A1:B1").Select
End If
End With
End Sub
J'aimerais pouvoir passé au suivant lorsque je tape par exemple que "balle"!!
Merci pour votre aide