Bonjour,
Je voudrais dans cette macro ajouté une poule de 3 comment faire
merci
Sub Macro4()
'
' Macro4 Macro
'
If I >= J Then
' Traitement poule de 4
'-----------------------
IndiceDeb = 0
IndiceFin = 0
For K = 1 To I
IndiceDeb = IndiceFin + 1
IndiceFin = IndiceDeb + 3
Sheets("Poule4").Copy Before:=Sheets(1)
Sheets("Poule4 (2)").Select
Sheets("Poule4 (2)").Name = "Poule4 " + nom + Str(K)
Sheets(nom).Select
Range("A" + CStr(IndiceDeb) + "" + CStr(IndiceFin)).Select
Selection.Copy
Sheets("Poule4 " + nom + Str(K)).Select
Range("A14").Select
ActiveSheet.Paste
Next K
' Traitement poule de 5
'-----------------------
For F = 1 To J
IndiceDeb = IndiceFin + 1
IndiceFin = IndiceDeb + 4
Sheets("Poule5").Copy Before:=Sheets(1)
Sheets("Poule5 (2)").Select
Sheets("Poule5 (2)").Name = "Poule5 " + nom + Str(F)
Sheets(nom).Select
Range("A" + CStr(IndiceDeb) + "" + CStr(IndiceFin)).Select
Selection.Copy
Sheets("Poule5 " + nom + Str(F)).Select
Range("A14").Select
ActiveSheet.Paste
Next F
End If
If I < J Then
IndiceDeb = 0
IndiceFin = 0
' Traitement poule de 5
'-----------------------
For F = 1 To J
IndiceDeb = IndiceFin + 1
IndiceFin = IndiceDeb + 4
Sheets("Poule5").Copy Before:=Sheets(1)
Sheets("Poule5 (2)").Select
Sheets("Poule5 (2)").Name = "Poule5 " + nom + Str(F)
Sheets(nom).Select
Range("A" + CStr(IndiceDeb) + "" + CStr(IndiceFin)).Select
Selection.Copy
Sheets("Poule5 " + nom + Str(F)).Select
Range("A14").Select
ActiveSheet.Paste
Next F
' Traitement poule de 4
'-----------------------
For K = 1 To I
IndiceDeb = IndiceFin + 1
IndiceFin = IndiceDeb + 3
Sheets("Poule4").Copy Before:=Sheets(1)
Sheets("Poule4 (2)").Select
Sheets("Poule4 (2)").Name = "Poule4 " + nom + Str(K)
Sheets(nom).Select
Range("A" + CStr(IndiceDeb) + "" + CStr(IndiceFin)).Select
Selection.Copy
Sheets("Poule4 " + nom + Str(K)).Select
Range("A14").Select
ActiveSheet.Paste
Next K
End If
End Sub
Je voudrais dans cette macro ajouté une poule de 3 comment faire
merci
Sub Macro4()
'
' Macro4 Macro
'
If I >= J Then
' Traitement poule de 4
'-----------------------
IndiceDeb = 0
IndiceFin = 0
For K = 1 To I
IndiceDeb = IndiceFin + 1
IndiceFin = IndiceDeb + 3
Sheets("Poule4").Copy Before:=Sheets(1)
Sheets("Poule4 (2)").Select
Sheets("Poule4 (2)").Name = "Poule4 " + nom + Str(K)
Sheets(nom).Select
Range("A" + CStr(IndiceDeb) + "" + CStr(IndiceFin)).Select
Selection.Copy
Sheets("Poule4 " + nom + Str(K)).Select
Range("A14").Select
ActiveSheet.Paste
Next K
' Traitement poule de 5
'-----------------------
For F = 1 To J
IndiceDeb = IndiceFin + 1
IndiceFin = IndiceDeb + 4
Sheets("Poule5").Copy Before:=Sheets(1)
Sheets("Poule5 (2)").Select
Sheets("Poule5 (2)").Name = "Poule5 " + nom + Str(F)
Sheets(nom).Select
Range("A" + CStr(IndiceDeb) + "" + CStr(IndiceFin)).Select
Selection.Copy
Sheets("Poule5 " + nom + Str(F)).Select
Range("A14").Select
ActiveSheet.Paste
Next F
End If
If I < J Then
IndiceDeb = 0
IndiceFin = 0
' Traitement poule de 5
'-----------------------
For F = 1 To J
IndiceDeb = IndiceFin + 1
IndiceFin = IndiceDeb + 4
Sheets("Poule5").Copy Before:=Sheets(1)
Sheets("Poule5 (2)").Select
Sheets("Poule5 (2)").Name = "Poule5 " + nom + Str(F)
Sheets(nom).Select
Range("A" + CStr(IndiceDeb) + "" + CStr(IndiceFin)).Select
Selection.Copy
Sheets("Poule5 " + nom + Str(F)).Select
Range("A14").Select
ActiveSheet.Paste
Next F
' Traitement poule de 4
'-----------------------
For K = 1 To I
IndiceDeb = IndiceFin + 1
IndiceFin = IndiceDeb + 3
Sheets("Poule4").Copy Before:=Sheets(1)
Sheets("Poule4 (2)").Select
Sheets("Poule4 (2)").Name = "Poule4 " + nom + Str(K)
Sheets(nom).Select
Range("A" + CStr(IndiceDeb) + "" + CStr(IndiceFin)).Select
Selection.Copy
Sheets("Poule4 " + nom + Str(K)).Select
Range("A14").Select
ActiveSheet.Paste
Next K
End If
End Sub