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 37 38 39 40 41 42 43 44 45 46 47 48 49
|
Sub Chercher()
Dim C13, RET, VB5
With Sheets("Feuil2")
'.Activate ' facultatif!!! find fonctionne tres bien sans activer la feuille dans un with/end with
Set PlageDeRecherche = .Range("A1", .Cells(Rows.Count, "A").End(xlUp))
With PlageDeRecherche
Set trouve = .Find(what:="1C13", LookAt:=xlWhole)
If Not trouve Is Nothing Then Sheets("Feuil2").Range("F1") = trouve.Offset(, 1).Value: C13 = trouve.Offset(, 1).Value
'trouve.Select
'ActiveCell.Offset(0, 1).Select
'Range("F1") = C13
Set trouve = .Find(what:="1RET", LookAt:=xlWhole)
If Not trouve Is Nothing Then Sheets("Feuil2").Range("F2") = trouve.Offset(, 1).Value: RET = trouve.Offset(, 1).Value
'trouve.Select
'ActiveCell.Offset(0, 1).Select
'Range("F2") = RET
Set trouve = .Find(what:="3VB5", LookAt:=xlWhole)
If Not trouve Is Nothing Then Sheets("Feuil2").Range("F3") = trouve.Offset(, 1).Value: VB5 = trouve.Offset(, 1).Value
'trouve.Select
'ActiveCell.Offset(0, 1).Select
'Range("F3") = VB5
End With
End With
With Sheets("Feuil2")
'.Activate ' facultatif!!! find fonctionne tres bien sans activer la feuille dans un with/end with
Set PlageDeRecherche = .Range("A1", .Cells(Rows.Count, "A").End(xlUp))
With PlageDeRecherche
Set trouve = .Find(what:="1C13", LookAt:=xlWhole)
If Not trouve Is Nothing Then trouve.Offset(, 1).Value = C13
'trouve.Select
'ActiveCell.Offset(0, 1).Select
'ActiveCell = C13
'Set PlageDeRecherche = ActiveSheet.Columns(1)
Set trouve = .Find(what:="1RET", LookAt:=xlWhole)
If Not trouve Is Nothing Then trouve.Offset(, 1).Value = RET
'trouve.Select
'ActiveCell.Offset(0, 1).Select
'ActiveCell = RET
'Set PlageDeRecherche = ActiveSheet.Columns(1)
Set trouve = .Find(what:="3VB5", LookAt:=xlWhole)
If Not trouve Is Nothing Then trouve.Offset(, 1).Value = VB5
'trouve.Select
'ActiveCell.Offset(0, 1).Select
'ActiveCell = VB5
End With
End With
End Sub |
Partager