Boucle VBA
Résolu
happy4u
Messages postés
39
Statut
Membre
-
happy4u Messages postés 39 Statut Membre -
happy4u Messages postés 39 Statut Membre -
Bonjour,
comment peut on mettre ce bout de code en boucle?
merci !!
comment peut on mettre ce bout de code en boucle?
Workbooks("s1.xlsm").Sheets("feuil1").Cells(Rows.Count, 5).End(xlUp)(2) = x.Offset(2).Value * 10 ^ 6
Workbooks("s1.xlsm").Sheets("feuil1").Cells(Rows.Count, 6).End(xlUp)(2) = x.Offset(3).Value * 10 ^ 6
Workbooks("s1.xlsm").Sheets("feuil1").Cells(Rows.Count, 8).End(xlUp)(2) = x.Offset(4).Value * 10 ^ 6
Workbooks("s1.xlsm").Sheets("feuil1").Cells(Rows.Count, 9).End(xlUp)(2) = x.Offset(5).Value * 10 ^ 6
Workbooks("s1.xlsm").Sheets("feuil1").Cells(Rows.Count, 10).End(xlUp)(2) = x.Offset(6).Value * 10 ^ 6
Workbooks("s1.xlsm").Sheets("feuil1").Cells(Rows.Count, 11).End(xlUp)(2) = x.Offset(7).Value * 10 ^ 6
Workbooks("s1.xlsm").Sheets("feuil1").Cells(Rows.Count, 12).End(xlUp)(2) = x.Offset(8).Value * 10 ^ 6
Workbooks("s1.xlsm").Sheets("feuil1").Cells(Rows.Count, 7).End(xlUp)(2) = x.Offset(9).Value * 10 ^ 6
merci !!
A voir également:
- Boucle VBA
- Vlc lecture en boucle ✓ - <a href="https://forums.commentcamarche.net/forum/lecteurs-et-supports-video-245">Forum Lecteurs et supports vidéo</a>
- Dépassement de capacité vba ✓ - <a href="https://forums.commentcamarche.net/forum/excel-145">Forum Excel</a>
- Incompatibilité de type vba ✓ - <a href="https://forums.commentcamarche.net/forum/programmation-3">Forum Programmation</a>
- L'indice n'appartient pas à la sélection vba - <a href="https://forums.commentcamarche.net/forum/vb-vba-267">Forum VB / VBA</a>
- Autofill vba ✓ - <a href="https://forums.commentcamarche.net/forum/excel-145">Forum Excel</a>
1 réponse
Bonjour
On peut toujours mais c'est pas forcément utile :
On peut toujours mais c'est pas forcément utile :
With Workbooks("s1.xlsm").Sheets("feuil1")
j = 2
For i = 5 To 12
If i = 7 Then
.Cells(Rows.Count, i).End(xlUp)(2) = x.Offset(j + 2).Value * 10 ^ 6
Else
.Cells(Rows.Count, i).End(xlUp)(2) = x.Offset(j).Value * 10 ^ 6
j = j + 1
End If
Next i
End With
happy4u
Messages postés
39
Statut
Membre
Thank you :))