Sub Liens()
Dim tablo As Variant, i As Integer, data As Collection, derval As String
Dim derlig As Integer, cell As Range, ligne As Integer
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
tablo = Sheets("ARCHIVES - Historique").Range("A1:F" & Sheets("ARCHIVES - Historique").Range("A20000").End(xlUp).Row)
Set data = New Collection
For i = 1 To UBound(tablo)
On Error Resume Next
If tablo(i, 1) = "GRH" Then
data.Add i, tablo(i, 5) & tablo(i, 6)
End If
Next i
derlig = Sheets("GRH").Range("B10000").End(xlUp).Row
For Each cell In Sheets("GRH").Range("B2:B" & derlig)
ligne = data(cell.Value & cell.Offset(0, 1).Value)
If cell.Offset(0, -1).Value <> ligne Then
cell.Offset(0, -1).Value = ligne
cell.Hyperlinks.Add Anchor:=cell.Offset(0, -1), Address:="", SubAddress:= _
"'ARCHIVES - Historique'!A" & ligne
End If
Next cell
Columns("A:A").Select
With Selection.Font
.Name = "Tahoma"
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
Selection.Font.ColorIndex = 5
Selection.Font.Underline = xlUnderlineStyleSingle
End With
End Sub