Répitition automatiques des lignes dans excel
Fermé
ronaldinoperez
Messages postés
6
Date d'inscription
lundi 3 novembre 2008
Statut
Membre
Dernière intervention
15 avril 2010
-
15 avril 2010 à 10:27
jejelefou Messages postés 304 Date d'inscription mercredi 21 mai 2008 Statut Membre Dernière intervention 18 février 2016 - 10 mai 2010 à 17:59
jejelefou Messages postés 304 Date d'inscription mercredi 21 mai 2008 Statut Membre Dernière intervention 18 février 2016 - 10 mai 2010 à 17:59
A voir également:
- Répitition automatiques des lignes dans excel
- Liste déroulante excel - Guide
- Formule excel - Guide
- Aller à la ligne excel - Guide
- Afficher toutes les lignes masquées excel ✓ - Forum Excel
- Figer une ligne excel - Guide
1 réponse
jejelefou
Messages postés
304
Date d'inscription
mercredi 21 mai 2008
Statut
Membre
Dernière intervention
18 février 2016
42
15 avril 2010 à 10:45
15 avril 2010 à 10:45
Bonjour :
voici le code :
Sub repete_5_fois()
imax = 5 'nombre de lignes à repeter
For i = 1 To imax
Sheets("feuil2").Cells(5 * i - 4, 1).Value = Sheets("feuil1").Cells(i, 1).Value
Sheets("feuil2").Cells(5 * i - 3, 1).Value = Sheets("feuil1").Cells(i, 1).Value
Sheets("feuil2").Cells(5 * i - 2, 1).Value = Sheets("feuil1").Cells(i, 1).Value
Sheets("feuil2").Cells(5 * i - 1, 1).Value = Sheets("feuil1").Cells(i, 1).Value
Sheets("feuil2").Cells(5 * i, 1).Value = Sheets("feuil1").Cells(i, 1).Value
Next
End Sub
a+
jéjé
voici le code :
Sub repete_5_fois()
imax = 5 'nombre de lignes à repeter
For i = 1 To imax
Sheets("feuil2").Cells(5 * i - 4, 1).Value = Sheets("feuil1").Cells(i, 1).Value
Sheets("feuil2").Cells(5 * i - 3, 1).Value = Sheets("feuil1").Cells(i, 1).Value
Sheets("feuil2").Cells(5 * i - 2, 1).Value = Sheets("feuil1").Cells(i, 1).Value
Sheets("feuil2").Cells(5 * i - 1, 1).Value = Sheets("feuil1").Cells(i, 1).Value
Sheets("feuil2").Cells(5 * i, 1).Value = Sheets("feuil1").Cells(i, 1).Value
Next
End Sub
a+
jéjé
15 avril 2010 à 12:09
votre code marche trés bien sauf q'l me permet de répéter une seule cellule de ligne et moi j'ai 6 colonnes et n'en pas une seule
tu peux m'aider là
15 avril 2010 à 15:51
imax = 5 'nombre de lignes à repeter
For i = 1 To imax
for j =1 to 6
Sheets("feuil2").Cells(5 * i - 4, j).Value = Sheets("feuil1").Cells(i, j).Value
Sheets("feuil2").Cells(5 * i - 3, j).Value = Sheets("feuil1").Cells(i, j).Value
Sheets("feuil2").Cells(5 * i - 2, j).Value = Sheets("feuil1").Cells(i, j).Value
Sheets("feuil2").Cells(5 * i - 1, j).Value = Sheets("feuil1").Cells(i, j).Value
Sheets("feuil2").Cells(5 * i, j).Value = Sheets("feuil1").Cells(i, j).Value
Next
next
End Sub
a+
jéjé
10 mai 2010 à 17:59
voici le code :
Sub repete_5_fois_6_colonnes()
imax = 5 'nombre de lignes à repeter
For i = 1 To imax
for j=1 to 6
Sheets("feuil2").Cells(5 * i - 4, j).Value = Sheets("feuil1").Cells(i, 1).Value
Sheets("feuil2").Cells(5 * i - 3, j).Value = Sheets("feuil1").Cells(i, 1).Value
Sheets("feuil2").Cells(5 * i - 2, j).Value = Sheets("feuil1").Cells(i, 1).Value
Sheets("feuil2").Cells(5 * i - 1, j).Value = Sheets("feuil1").Cells(i, 1).Value
Sheets("feuil2").Cells(5 * i, j).Value = Sheets("feuil1").Cells(i, 1).Value
Next
Next
End Sub
a+