Re : Traduction macro vba
voici plutot un autre code qui correspond quand même mieux (il ne doit pas être très propre mais bon)
'
Dim page As String
Dim adcel As String
Dim combo As String
Dim rech As String
Dim trouve1 As Object
Dim plage As Range
Dim vall As Variant
Dim dd As Variant
Dim gkjj As Integer
Dim vall2 As Variant
Dim trouve2 As Variant
On Error Resume Next
gkjj = 0
page = ActiveSheet.Name 'défini la page de départ
adcel = ActiveCell.Address 'défini l'adresse de la cellule
rech = Feuil3.Cells(1, 1).Value
Application.ScreenUpdating = False
Feuil10.Select
trouve2 = Cells(1, 1)
With Feuil10
Range(Cells(2, 13), Cells(3, 26)).Clear
Range(Cells(3, 13), Cells(3, 26)).Select
Selection.NumberFormat = "dd/mm/yy;@"
Columns(7).Select
On Error Resume Next
Selection.Find(What:=(rech), after:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Application.CutCopyMode = False
Range(Cells(ActiveCell.Row, ActiveCell.Column + 1), Cells(ActiveCell.Row + 1, ActiveCell.Column + 2)).Select
Selection.Copy
Cells(2, 13).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Columns(4).Select
Set trouve1 = Range("D1😀50").Find(rech, after:=ActiveCell, LookIn:=xlValues) ', LookAt:=_
'xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
', SearchFormat:=False) 'trouve1 sera l première cellule trouvé avec une adresse propre
If trouve1 Is Nothing Then GoTo line3
If gkjj = 20 Then
Exit Sub
Else
trouve1.Select
Set trouve2 = trouve1 'trouve2 prend l'adresse de trouve1
vall2 = Cells(ActiveCell.Row, ActiveCell.Column - 2).Value
vall = Cells(ActiveCell.Row, ActiveCell.Column - 1).Value
Range(Cells(2, 15), Cells(2, 23)).End(xlToLeft).Select
'Range("DZ" & jjjt).End(xlToLeft).Select
ActiveCell.Offset(1, 1).Select
ActiveCell = vall
ActiveCell.Offset(-1, 0).Select
ActiveCell = vall2
Set plage = Range("d2:d300")
Do
With Feuil10.Range("d2:d200")
trouve1.Select
'Columns(4).Activate
line2: Cells.FindNext(after:=ActiveCell).Select
If ActiveCell.Column <> 4 Then GoTo line2
Set trouve1 = Cells.FindNext(after:=ActiveCell)
' Set trouve1 = FindNext(rech, After:=ActiveCell, LookIn:=xlValues)
Set trouve1 = ActiveCell
trouve1.Select
If trouve1.Address = trouve2.Address Then GoTo line3
vall2 = Cells(ActiveCell.Row, ActiveCell.Column - 2).Value
vall = Cells(ActiveCell.Row, ActiveCell.Column - 1).Value
Range(Cells(3, 23), Cells(3, 13)).End(xlToRight).Select
'Range("DZ" & jjjt).End(xlToLeft).Select
ActiveCell.Offset(0, 1).Select
ActiveCell = vall
ActiveCell.Offset(-1, 0).Select
ActiveCell = vall2
dd = trouve1.Address
Cells(1, 11).Value = "trouve1" & trouve1.Column
Cells(2, 11).Value = "trouve2" & trouve2.Column
gkjj = gkjj + 1
End With
Cells(16, 15).Value = trouve1.Address
Cells(16, 16).Value = trouve2.Address
Loop While trouve1.Address <> trouve2.Address
line3: Application.ScreenUpdating = True
End If
End With
Sheets(page).Select 'sélectionne la page de départ
Cells(adcel).Select 'sélectionne la cellule de départ
il n'ya sans doute que quelques lignes qui te seront utiles
bonne soirée
bon courage