1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
Dim cell As Range, PlageDeRecherche As Range
Dim Valeur_Cherchee As String, AdresseTrouvee As String
Sheets("Paramètres").Visible = True
Sheets("CAISSE").Visible = True
Sheets("CAISSE").Activate
Valeur_Cherchee = Sheets("Paramètres").Range("AA2").Value
Set PlageDeRecherche = Sheets("CAISSE").Range("A12:A742")
Set cell = PlageDeRecherche.Cells.Find(what:=Valeur_Cherchee, LookAt:=xlWhole)
If cell Is Nothing Then
AdresseTrouvee = Valeur_Cherchee & " n'est pas présent dans " & PlageDeRecherche.Address
Else
cell.Select
ActiveCell.Offset(0, 2).Value = Sheets("Paramètres").Range("AB4").Value
ActiveCell.Offset(0, 4).Value = Sheets("Paramètres").Range("AB6").Value
ActiveCell.Offset(0, 5).Value = Sheets("Paramètres").Range("AB7").Value
ActiveCell.Offset(0, 6).Value = Sheets("Paramètres").Range("AB8").Value
Set PlageDeRecherche = Nothing
Set cell = Nothing
Sheets("CAISSE").Visible = False
Sheets("Paramètres").Select
Range("AL2:AN20").Select
Sheets("Paramètres").Select
Sheets("Paramètres").Visible = False
Selection.Cut
End If |
Partager