Sub CleanImages() 'Contrôle Format Images
Dim var
Dim R As Range
Dim S As Worksheet
Dim i&
Dim cpt&
Dim A$
Dim Ref$
Dim bool As Boolean
Dim T()
Set S = ActiveWorkbook.Sheets(DATA)
Set R = S.Range(S.Cells(1, 1), S.Cells(S.[bd65536].End(xlUp).Row, 56))
var = R
For i& = 2 To UBound(var, 1)
bool = False
A$ = var(i&, 56) 'commodité d'écriture
If A$ <> "" Then
If LCase(Right(A$, 4)) <> ".jpg" And _
LCase(Right(A$, 4)) <> ".gif" Then bool = True
If Left(A$, Len(Trim(var(i&, 1)))) <> Trim(var(i&, 1)) Then bool = True
If var(i&, 1) = "" Then bool = True
If InStr(1, A$, Chr(160)) Then bool = True
If InStr(1, A$, Space(1)) Then bool = True
If InStr(1, A$, "_") = 0 Then bool = True
If bool Then
cpt& = cpt& + 1
ReDim Preserve T(1 To 1, 1 To cpt&)
If REF_ABS Then
Ref$ = "$BD$"
Else
Ref$ = "BD"
End If
T(1, cpt&) = Ref$ & i&
End If
End If
Next i&
Set S = ActiveWorkbook.Sheets(CONTROLE)
S.Range("p12:p65536").ClearContents
If cpt& > 0 Then 'modif
Set R = S.Range("P12:P" & UBound(T, 2) + 12 - 1 & "")
R = WorksheetFunction.Transpose(T)
End If 'modif
MsgBox ("Terminé")
End Sub