Sub FormatMACAddress()
Dim WS As Worksheet
Dim i As Long
Dim NbLignes As Long
Dim S As String
'-----------------------
Const NoColonneMACAddress = 27
Const LongueurMACAddress = 12
Const NbLignesTitres = 3
'-----------------------
'Initialisations
Set WS = ActiveSheet 'Adapter si nécessaire
If Not WS.AutoFilter Is Nothing Then WS.AutoFilter.ShowAllData
NbLignes = WS.Cells(Rows.Count, NoColonneMACAddress).End(xlUp).Row
'Parcours des MAC@
For i = NbLignesTitres + 1 To NbLignes
S = UCase(Trim(CStr(WS.Cells(i, NoColonneMACAddress).Value)))
If Len(S) = LongueurMACAddress Then
WS.Cells(i, NoColonneMACAddress).Value = Format(S, "@@:@@:@@:@@:@@:@@")
End If
Next i
End Sub