Je dois dupliquer, une ligne d'un tableau (choix par inputbox) quand cela est nécessaire, la coller juste après après celle-ci, j'y arrive avec la macro présente dans mon fichier, le soucis que si j'essaye de dupliquer la dernière ligne de mon tableau, il copie la ligne hors du tableau...
Utilisez le fait qu'il s'agit d'un tableau structuré :
VB:
With [Tableau1] 'tableau structuré
For i = .Rows.Count To 1 Step -1
If .Cells(i, 3) = nom Then
.Rows(i + 1).Insert xlDown
.Rows(i).Copy .Rows(i + 1)
.Cells(i + 1, 12) = "2ème instrument"
End If
Next i
End With
Utilisez le fait qu'il s'agit d'un tableau structuré :
VB:
With [Tableau1] 'tableau structuré
For i = .Rows.Count To 1 Step -1
If .Cells(i, 3) = nom Then
.Rows(i + 1).Insert xlDown
.Rows(i).Copy .Rows(i + 1)
.Cells(i + 1, 12) = "2ème instrument"
End If
Next i
End With