Sub convertH()
Const minDec = 1 / 60, repere As String = "Nom/prénom"
Dim datas, lig As Long, col As Long, signe As Boolean, tmp, cel1 As Range
Set cel1 = [1:2].Find(repere, , xlValues, xlWhole, , , , xlText)
If cel1 Is Nothing Then MsgBox repere & " non trouvé en ligne 1": Exit Sub
Set cel1 = cel1(1)
col = Cells(1, Columns.Count).End(xlToLeft).Column ' dernière colonne
lig = Cells(Rows.Count, cel1.Column + 1).End(xlUp).Row ' dernière ligne
Range(cel1.Offset(1, 1), Cells(lig, col)).Select
datas = Range(cel1.Offset(1, 1), Cells(lig, col)).Value
For lig = 1 To UBound(datas, 1)
For col = 1 To UBound(datas, 2)
If InStr(datas(lig, col), ":") > 0 Then
signe = Left(datas(lig, col), 1) = "-"
If signe Then datas(lig, col) = Mid(datas(lig, col), 2)
' des heures >24 empêchent d'utiliser TimeValue pour la conversion
tmp = Split(datas(lig, col), ":")
datas(lig, col) = Round(tmp(0) + tmp(1) * minDec, 7)
If signe Then datas(lig, col) = -datas(lig, col)
End If
Next col
Next lig
With cel1.Offset(1, 1).Resize(UBound(datas, 1), UBound(datas, 2))
.Value = datas
.NumberFormat = "0.00""h"";-0.00""h"";;@"
End With
End Sub