Bonjour,


je découvre les macros depuis peu et j'ai un petit soucis.
j'ai réussi à créer une macro qui fait bien ce que je souhaite obtenir
cependant j'ai besoin qu'elle se répéte
je m'explique :
j'ai en A5 (Y dans ma macro ) un login d'une personne et je souhaite que ma macro se répète en faisant les meme calcul avec le login suivant qui est en A6 et ainsi de suite jusqu'à ce que la case en Axx soit vide ( je peux avoir 10 noms comme 200 suivant l'activité de mon service )
voici ma macro

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
Sub Stow() 
' 
' Stow Macro 
' 
 
' 
Dim U As Variant 
Dim Y As Variant 
 
U = Sheets("Bilan").Cells(1, 3) 
Y = Sheets("Bilan").Cells(5, 1) 
 
Sheets("stow").Select 
 
Cells.Select 
Selection.ClearContents 
 
 
 
 
' With ActiveSheet.QueryTables.Add(Connection:= _ 
' "URL;https://xxx/fc-cgi/picking/pick-history.cgi?attribute=PickerId&value=" & Y & "&from=" & U & "+00%3A00%3A00&to=" & U & "+23%3A00%3A41" _
 ' , Destination:=Range("$A$1")) 
' .Name = _ 
' "pick-history.cgi?attribute=PickerId&value=" & Y & "&from=" & U & "+00%3A00%3A00&to=" & U & "+15%3A44%3A41"
 With ActiveSheet.QueryTables.Add(Connection:= _ 
"URL;https://xxx/fc-cgi/spaceman/stow-history.cgi?haveInput=true&beginDate=" & U & "&endDate=" & U & "&userId=" & Y & "&containerScannableId=&endLocation=&fcSkuOrContainer=" _
 , Destination:=Range("$A$1")) 
.Name = _ 
"stow-history.cgi?haveInput=true&beginDate=" & U & "&endDate=" & U & "&userId=" & Y & "&containerScannableId=&endLocation=&fcSkuOrContainer="
 
 
 
 
.FieldNames = True 
.RowNumbers = False 
.FillAdjacentFormulas = False 
.PreserveFormatting = True 
.RefreshOnFileOpen = False 
.BackgroundQuery = True 
.RefreshStyle = xlInsertDeleteCells 
.SavePassword = False 
.SaveData = True 
.AdjustColumnWidth = True 
.RefreshPeriod = 0 
.WebSelectionType = xlSpecifiedTables 
.WebFormatting = xlWebFormattingNone 
.WebTables = "1" 
.WebPreFormattedTextToColumns = True 
.WebConsecutiveDelimitersAsOne = True 
.WebSingleBlockTextImport = False 
.WebDisableDateRecognition = False 
.WebDisableRedirections = False 
.Refresh BackgroundQuery:=False 
End With 
 
'en tete colone 
Range("G2").Select 
ActiveCell.FormulaR1C1 = "delta temps" 
Range("H2").Select 
ActiveCell.FormulaR1C1 = "stop" 
Range("I2").Select 
ActiveCell.FormulaR1C1 = "temps d'arret" 
Range("K2").Select 
ActiveCell.FormulaR1C1 = "temps changement bac" 
 
 
 
'modif format heure 
 
Cells.Select 
Range("N22").Activate 
Selection.Replace What:=".", Replacement:="/", LookAt:=xlPart, _ 
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ 
ReplaceFormat:=False 
 
'calcul delta temps 
 
 
Range("G4").Select 
ActiveCell.FormulaR1C1 = _ 
"=IF(RC[-1]=0,"""",RC[-6]-R[-1]C[-6])" 
Columns("G:G").Select 
Selection.NumberFormat = "[$-A400]h:mm:ss AM/PM" 
Range("G4").Select 
Selection.AutoFill Destination:=Range("G4:G9999"), Type:=xlFillDefault 
Range("G4:G9999").Select 
 
'modif format colonne delta temps 
Columns("G:G").Select 
Selection.NumberFormat = "hh:mm:ss " 
 
'met stop en colonne H 
 
 
Range("H4").Select 
ActiveCell.FormulaR1C1 = _ 
"=IF(AND(RC[-1]>Synthèse!R1C6,RC[-3]=R[-1]C[-3]),""STOP"","""")" 
Range("H4").Select 
Selection.AutoFill Destination:=Range("H4:H999"), Type:=xlFillDefault 
Range("H4:H9999").Select 
Range("I4").Select 
ActiveCell.FormulaR1C1 = "=IF(RC[-1]=""STOP"",RC[-2],0)" 
Range("I4").Select 
Selection.AutoFill Destination:=Range("I4:I9999"), Type:=xlFillDefault 
Range("I4:I9999").Select 
ActiveWindow.SmallScroll Down:=-12 
Columns("I:I").Select 
Range("I953").Activate 
' Selection.NumberFormat = "[$-F400]h:mm:ss AM/PM" 
' Range("G4").Select 
' ActiveCell.FormulaR1C1 = "=IF(RC[-1]>0,RC[-1]-R[-1]C[-1],0)" 
' Range("G4").Select 
' Selection.AutoFill Destination:=Range("G4:G9999") 
' Range("G4:G9999").Select 
 
' ActiveCell.FormulaR1C1 = "=IF(RC[-4]>0,0,RC[-3])" 
' Range("I4").Select 
' Selection.Copy 
 
 
' Range("R3").Select 
' ActiveCell.FormulaR1C1 = "=IF(AND(RC[-9]>0,RC[-3]<Synthèse!R1C7),0,RC[-3])" 
' Range("R3").Select 
' Selection.AutoFill Destination:=Range("R3:R999") 
' Range("R3:R999").Select 
 
Range("K4").Select 
ActiveCell.FormulaR1C1 = _ 
"=IF(AND(RC[-6]<>R[-1]C[-6],RC[-4]<Synthèse!R1C7),RC[-4],0)" 
Range("K4").Select 
Selection.AutoFill Destination:=Range("K4:K9999") 
Range("K4:K9999").Select 
 
'modif format heure colonne K 
Columns("k:k").Select 
Selection.NumberFormat = "hh:mm:ss " 
 
Sheets("bilan").Select 
End Sub