bonsoir Alain, Kloss,le forum,
Voici une partie de mon code pour aider à la compréhension
la valeur recherchée est du texte et des nombres avec décimales donc différentes à chaque recherche !
Voici mon code :
Dim Adresse As String
Dim C As Object
Dim Mot As StringDim TheRow As Integer
Dim I, b, e, g, h As Variant
Application.ScreenUpdating = False
'Si case à cocher est faux Msgbox...
If CheckBox1.Value = False Then
MsgBox 'Cliquez sur la case recherche standart pour activer la recherche', vbInformation, 'POTAIN_CHL'
Else
' suite du code
Mot = InputBox(' STANDART à rechercher ?', 'POTAIN CHARLIEU')
'Contrôles avant recherche
If Mot = '' Then Exit Sub
If Application.CountIf(Range('A:A'), Mot) = 0 Then MsgBox 'MATIERE INTROUVABLE! vérifier le numéro !', vbCritical, 'POTAIN_CHL': Exit Sub
'Recherche
Set plage = Sheets('Nuances').Range('A:A')
With plage
Set C = .Find(Mot)
If Not C Is Nothing Then
Adresse = C.Address
'Recherche en cas de doublons
Do
TheRow = C.Row
'Transport à la ligne du mot recherché
ActiveWindow.ScrollRow = TheRow
'Message définisant la ligne du mot recherché
MsgBox 'LE STANDART FER ' & Mot & ' se trouve à la ligne ' & TheRow & ', Cliquez sur ok !', vbInformation, 'POTAIN_CHL'
Set C = .FindNext(C)
C.Select
'sélectionne la ème cellule à partir de l'active + définition variables
I = ActiveCell.Offset(0, 1).Value
b = ActiveCell.Offset(0, 2).Value
e = ' , code matière : '
g = ' , dimension/format : '
h = ''
'affichage dans textBox2
TextBox2 = ActiveCell.Offset(0, 0).Value & e & h & I & h & h & g & b
Loop While Not C Is Nothing And C.Address <> Adresse
Application.ScreenUpdating = True
End If
End With
End If
End Sub
Merci pour l'aide
@+
Nanard