Faire une Function avec un Boucle
Résolu
etudiant1_ing
Messages postés
3
Date d'inscription
Statut
Membre
Dernière intervention
-
etudiant1_ing Messages postés 3 Date d'inscription Statut Membre Dernière intervention -
etudiant1_ing Messages postés 3 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
J'effectue a plusieurs reprises cette boucle,
j'aime faire une function avec ce qui pourrait alléger d'avantage mon code.
Mon problème est l'appellation dans ma function de ma feuille Terminal#1
For i = 10 To comp Step 2
Sheets("Terminal #1").Cells(a, 1) = Cells(i, 3)
Sheets("Terminal #1").Cells(a, 5) = Cells(i, 7)
Sheets("Terminal #1").Cells(a, 10) = Cells(i, 12)
Sheets("Terminal #1").Cells(a, 31) = Cells(i, 33)
Sheets("Terminal #1").Cells(a, 34) = Cells(i, 36)
a = a + 2
End If
Next i
Merci à l'avance
J'effectue a plusieurs reprises cette boucle,
j'aime faire une function avec ce qui pourrait alléger d'avantage mon code.
Mon problème est l'appellation dans ma function de ma feuille Terminal#1
For i = 10 To comp Step 2
Sheets("Terminal #1").Cells(a, 1) = Cells(i, 3)
Sheets("Terminal #1").Cells(a, 5) = Cells(i, 7)
Sheets("Terminal #1").Cells(a, 10) = Cells(i, 12)
Sheets("Terminal #1").Cells(a, 31) = Cells(i, 33)
Sheets("Terminal #1").Cells(a, 34) = Cells(i, 36)
a = a + 2
End If
Next i
Merci à l'avance
A voir également:
- Faire une Function avec un Boucle
- Boucle excel sans macro - Forum Excel
- Mon pc s'allume et s'éteint en boucle ✓ - Forum Matériel & Système
- Mise à disposition de boucle locale dédiée ✓ - Forum Freebox
- Vlc lire en boucle ✓ - Forum Lecteurs et supports vidéo
- Xiaomi s'éteint tout seul et se rallume en boucle - Forum Xiaomi
3 réponses
Bonjour,
Voici un excellent cours VBA pour débutants (et autres) :
ftp://ftp-developpez.com/bidou/Cours/VBA/formationVBA.pdf
Tu trouvera la réponse page 32 : Instructions et règles d'appel
Voici un excellent cours VBA pour débutants (et autres) :
ftp://ftp-developpez.com/bidou/Cours/VBA/formationVBA.pdf
Tu trouvera la réponse page 32 : Instructions et règles d'appel
Voici ce que je veux faire :
Arg1 = a (integer)
Arg2 = Terminal #1 nom de ma feuille
Call PLACEMENT( a, Terminal #1)
Public Function Placement(arg1 As Integer, arg2 As *****)
Sheets("Arg2").Cells(Arg1, 1) = Cells(i, 3)
Sheets("Arg2").Cells(Arg1, 5) = Cells(i, 7)
Sheets("Arg2").Cells(Arg1, 10) = Cells(i, 12)
Sheets("Arg2").Cells(Arg1, 31) = Cells(i, 33)
Sheets("Arg2").Cells(Arg1, 34) = Cells(i, 36)
End function
Le problème est le Terminal #1 qui est en text, je sais pas comment l'importer dans ma function
merci
Arg1 = a (integer)
Arg2 = Terminal #1 nom de ma feuille
Call PLACEMENT( a, Terminal #1)
Public Function Placement(arg1 As Integer, arg2 As *****)
Sheets("Arg2").Cells(Arg1, 1) = Cells(i, 3)
Sheets("Arg2").Cells(Arg1, 5) = Cells(i, 7)
Sheets("Arg2").Cells(Arg1, 10) = Cells(i, 12)
Sheets("Arg2").Cells(Arg1, 31) = Cells(i, 33)
Sheets("Arg2").Cells(Arg1, 34) = Cells(i, 36)
End function
Le problème est le Terminal #1 qui est en text, je sais pas comment l'importer dans ma function
merci