Option Explicit
Sub Transfert()
Dim DerLigne As Integer, Lig
Dim Col As Byte, DerCol As Byte, ColCible As Byte
Dim VNom As String, DebNom As String, VHeure As Variant
'With Worksheets("Feuil1")
With ActiveSheet 'Worksheets("feuil1")
.Range("AD3:AL62").ClearContents
' Trouver la dernière colonne du tableau
DerCol = .Range("IV3").End(xlToLeft).Column
' Trouver la dernière ligne du tableau
DerLigne = .Range("B" & Rows.Count).End(xlUp).Row
' Pour chaque ligne remplie du tableau
For Lig = 3 To DerLigne
' Pour chaque colonne
For Col = 3 To 8 Step 2
VNom = .Cells(Lig, Col).Value
DebNom = Left(VNom, 2)
Select Case Col
Case 3: ColCible = 30
Case 5: ColCible = 32
Case 7: ColCible = 34
Case Else: ColCible = 0
End Select
If VNom <> "" And InStr(1, "R/A/M/", DebNom) > 0 Then
DerLigne = .Cells(Rows.Count, ColCible).End(xlUp).Row + 1
.Cells(DerLigne, ColCible) = VNom
'.Cells(DerLigne, Colcible + 1) = Tabtemp(Ligne, 4) 'Heure
.Cells(DerLigne, ColCible + 1) = .Cells(Lig, DerCol) 'Ligne
End If
Next
Next
End With
End Sub