bonjour
pouvez vous me dire si ses possible car j'ai fait une feuille de calcul le code prend en charge la résolution de l'écran j'usque la pas de probléme tous fonction trés bien
mais ma question et quand j'ai fermer ma feuille de calcul et que j'ouvre d'autre fichier excel la résolution change peux ton modifier le code pour que sa reste j'uste sur la feuille de calcul mais pas sur les autres
merci
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250 Option Explicit 'l'API GetSystemMetrics permet de retrouver la résolution 'de l'écran. Private Declare Function GetSystemMetrics Lib "user32.dll" _ (ByVal nIndex As Long) As Long Const DATADIR As String = "C:\Documents and Settings\HP_Administrateur\Mes documents\compte\compte50 modifier\" Private Sub CommandButton1_Click() Dim wkb As Workbook Set wkb = Workbooks.Open(Filename:=(DATADIR & "compte février.xls")) If Not wkb Is Nothing Then With wkb.Windows(1) .WindowState = xlNormal .Top = 0 .Left = 0 .Height = Application.UsableHeight .Width = Application.UsableWidth End With End If End Sub Private Sub CommandButton10_Click() Dim wkb As Workbook Set wkb = Workbooks.Open(Filename:=(DATADIR & "compte octobre.xls")) If Not wkb Is Nothing Then With wkb.Windows(1) .WindowState = xlNormal .Top = 0 .Left = 0 .Height = Application.UsableHeight .Width = Application.UsableWidth End With End If End Sub Private Sub CommandButton11_Click() Dim wkb As Workbook Set wkb = Workbooks.Open(Filename:=(DATADIR & "compte novembre.xls")) If Not wkb Is Nothing Then With wkb.Windows(1) .WindowState = xlNormal .Top = 0 .Left = 0 .Height = Application.UsableHeight .Width = Application.UsableWidth End With End If End Sub Private Sub CommandButton12_Click() Dim wkb As Workbook Set wkb = Workbooks.Open(Filename:=(DATADIR & "compte decembre.xls")) If Not wkb Is Nothing Then With wkb.Windows(1) .WindowState = xlNormal .Top = 0 .Left = 0 .Height = Application.UsableHeight .Width = Application.UsableWidth End With End If End Sub Private Sub CommandButton13_Click() Dim wkb As Workbook Set wkb = Workbooks.Open(Filename:=(DATADIR & "semaine.xls")) If Not wkb Is Nothing Then With wkb.Windows(1) .WindowState = xlNormal .Top = 0 .Left = 0 .Height = Application.UsableHeight .Width = Application.UsableWidth End With End If End Sub Private Sub CommandButton14_Click() Dim ie As Object Set ie = CreateObject("InternetExplorer.Application") With ie .Visible = True .Top = 0 .Left = 0 .Width = GetSystemMetrics(0) .Height = GetSystemMetrics(1) .Navigate "http://www.ca-norddefrance.fr/" End With End Sub Private Sub CommandButton15_Click() Dim wkb As Workbook Dim i As Long 'Application.DisplayAlerts = False For Each wkb In Workbooks With wkb If .Windows.Count > 1 And Not .Name = ThisWorkbook.Name Then For i = .Windows.Count To 2 Step -1 .Save .Close Next i End If End With Next wkb Set wkb = Nothing Application.Quit End Sub Private Sub CommandButton2_Click() Dim wkb As Workbook Set wkb = Workbooks.Open(Filename:=(DATADIR & "compte janvier.xls")) If Not wkb Is Nothing Then With wkb.Windows(1) .WindowState = xlNormal .Top = 0 .Left = 0 .Height = Application.UsableHeight .Width = Application.UsableWidth End With End If End Sub Private Sub CommandButton3_Click() Dim wkb As Workbook Set wkb = Workbooks.Open(Filename:=(DATADIR & "compte mars.xls")) If Not wkb Is Nothing Then With wkb.Windows(1) .WindowState = xlNormal .Top = 0 .Left = 0 .Height = Application.UsableHeight .Width = Application.UsableWidth End With End If End Sub Private Sub CommandButton4_Click() Dim wkb As Workbook Set wkb = Workbooks.Open(Filename:=(DATADIR & "compte avril.xls")) If Not wkb Is Nothing Then With wkb.Windows(1) .WindowState = xlNormal .Top = 0 .Left = 0 .Height = Application.UsableHeight .Width = Application.UsableWidth End With End If End Sub Private Sub CommandButton5_Click() Dim wkb As Workbook Set wkb = Workbooks.Open(Filename:=(DATADIR & "compte mai.xls")) If Not wkb Is Nothing Then With wkb.Windows(1) .WindowState = xlNormal .Top = 0 .Left = 0 .Height = Application.UsableHeight .Width = Application.UsableWidth End With End If End Sub Private Sub CommandButton6_Click() Dim wkb As Workbook Set wkb = Workbooks.Open(Filename:=(DATADIR & "compte juin.xls")) If Not wkb Is Nothing Then With wkb.Windows(1) .WindowState = xlNormal .Top = 0 .Left = 0 .Height = Application.UsableHeight .Width = Application.UsableWidth End With End If End Sub Private Sub CommandButton7_Click() Dim wkb As Workbook Set wkb = Workbooks.Open(Filename:=(DATADIR & "compte juillet.xls")) If Not wkb Is Nothing Then With wkb.Windows(1) .WindowState = xlNormal .Top = 0 .Left = 0 .Height = Application.UsableHeight .Width = Application.UsableWidth End With End If End Sub Private Sub CommandButton8_Click() Dim wkb As Workbook Set wkb = Workbooks.Open(Filename:=(DATADIR & "compte aout.xls")) If Not wkb Is Nothing Then With wkb.Windows(1) .WindowState = xlNormal .Top = 0 .Left = 0 .Height = Application.UsableHeight .Width = Application.UsableWidth End With End If End Sub Private Sub CommandButton9_Click() Dim wkb As Workbook Set wkb = Workbooks.Open(Filename:=(DATADIR & "compte septembre.xls")) If Not wkb Is Nothing Then With wkb.Windows(1) .WindowState = xlNormal .Top = 0 .Left = 0 .Height = Application.UsableHeight .Width = Application.UsableWidth End With End If End Sub
Partager