Sub Combinaison()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Sheets(1).Activate
ActiveSheet.Buttons.Delete
Alpha = Cells(Rows.Count, "B").End(xlUp).Row
For i = 1 To Alpha - 1
Cells(Alpha - i, 2).Copy
Range(Cells(1, (Alpha + 4) - i), Cells(i, (Alpha + 4) - i)).Select
ActiveSheet.Paste
For j = 1 To Alpha
If Cells(j, (Alpha + 4) - i) <> "" Then
Cells(j, (Alpha + 4) - i) = Cells(j, (Alpha + 4) - i).Value + Cells(Alpha - i + j, 2).Value
End If
Next
Next
Beta = Cells(5, Columns.Count).End(xlToRight).Column
Alpha = Cells(Rows.Count, "E").End(xlUp).Row
Sheets(1).Activate
tableauAdresses = cellsSearch(Range(Cells(1, 5), Cells(Alpha, Beta)), Range("A1"))
Sheets(5).Range("A1:Z1") = tableauAdresses
Sheets(5).Activate
Rows("1:1").Select
Selection.Copy
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Rows(1).Delete
Delta = Cells(Rows.Count, "A").End(xlUp).Row
For d = 1 To Delta
If WorksheetFunction.IsNA(Cells(d, 1)) = True Then
Rows(d).Clear
End If
Next
Sheets(1).Activate
Range("B:B").Copy
Sheets(3).Activate
Range("A:A").Select
ActiveSheet.Paste
Sheets(2).Activate
Range("A:A").Select
ActiveSheet.Paste
Sheets(1).Activate
Range("C:C").Copy
Sheets(2).Activate
Range("B:B").Select
ActiveSheet.Paste
Sheets(5).Activate
Range("A:A").Copy
Sheets(2).Activate
Range("D:D").Select
ActiveSheet.Paste
Sheets(1).Activate
Alpha = Cells(Rows.Count, "B").End(xlUp).Row
Beta = Cells(1, Columns.Count).End(xlToRight).Column
For i = 1 To Alpha - 1
Worksheets(1).Cells(Alpha - i, 2).Copy
Sheets(3).Activate
Range(Cells(1, (Alpha + 4) - i), Cells(i, (Alpha + 4) - i)).Select
ActiveSheet.Paste
For j = 1 To Alpha
If Worksheets(3).Cells(j, (Alpha + 4) - i) <> "" Then
Worksheets(3).Cells(j, (Alpha + 4) - i) = (Worksheets(1).Cells(j, (Alpha + 4) - i).Value - Worksheets(1).Cells(Alpha - i + j, 2).Value)
Worksheets(4).Cells(j, (Alpha + 4) - i) = Worksheets(1).Cells(Alpha - i + j, 2).Value
End If
Next
Next
Sheets(2).Activate
Gama = Cells(Rows.Count, "D").End(xlUp).Row
For p = 1 To Gama
Cells(p, 5) = Worksheets(3).Range(Worksheets(2).Cells(p, 4))
Cells(p, 7) = Worksheets(4).Range(Worksheets(2).Cells(p, 4))
Next
For q = 1 To Gama
Cells(q, 6) = Application.WorksheetFunction.VLookup(Cells(q, 5), Range("A:B"), 2)
Next
For s = 1 To Gama
Cells(s, 8) = Application.WorksheetFunction.VLookup(Cells(s, 7), Range("A:B"), 2)
Next
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub