IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Excel Discussion :

résolution de l'écran


Sujet :

Excel

  1. #1
    Membre du Club
    Profil pro
    Inscrit en
    Novembre 2007
    Messages
    69
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2007
    Messages : 69
    Points : 43
    Points
    43
    Par défaut résolution de l'écran
    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
    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
    merci

  2. #2
    Rédacteur/Modérateur
    Avatar de loufab
    Homme Profil pro
    Entrepreneur en solutions informatiques viables et fonctionnelles.
    Inscrit en
    Avril 2005
    Messages
    11 987
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Pyrénées Atlantiques (Aquitaine)

    Informations professionnelles :
    Activité : Entrepreneur en solutions informatiques viables et fonctionnelles.
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2005
    Messages : 11 987
    Points : 24 540
    Points
    24 540
    Par défaut
    Bonjour,

    J'ai rien compris. Peut-être qu'avec un minimum de ponctuation j'y verrais plus clair.
    Détecter les modifications formulaire Cloud storage et ACCESS
    Classe MELA(CRUD) Opérateur IN et zone de liste Opérateur LIKE
    Visitez mon Blog
    Les questions techniques par MP ne sont pas lues et je ne pratique pas la bactériomancie

  3. #3
    Membre du Club
    Profil pro
    Inscrit en
    Novembre 2007
    Messages
    69
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2007
    Messages : 69
    Points : 43
    Points
    43
    Par défaut
    voila le code qui permet de changer la résolution de l'écran
    Private Sub Workbook_Open()
    With Me.Windows(1)
    .WindowState = xlNormal
    .Top = 1
    .Left = 1
    .Height = Application.UsableHeight
    .Width = Application.UsableWidth
    End With
    CalculerZoomOptimal
    End Sub

    Private Sub CalculerZoomOptimal()
    Dim zm As Long
    Dim lFacteur As Long

    lFacteur = 1
    zm = 110
    Application.ScreenUpdating = False
    With Me
    Do
    .Windows(1).Zoom = zm
    zm = zm - lFacteur
    Loop Until .Windows(1).VisibleRange.Columns.Count > .Names("VisibleRange").RefersToRange.Columns.Count And _
    .Windows(1).VisibleRange.Rows.Count > .Names("VisibleRange").RefersToRange.Rows.Count
    End With
    Application.ScreenUpdating = True
    Ce que je veux c'est que lorsque je ferme le fichier et que j'en ouvre un autre la fenêtre ne soit pas réduite (voir l'exemple).
    merci.
    ps : je ne suis que débutant, excusez moi si ce n'est pas très clair

Discussions similaires

  1. Réponses: 3
    Dernier message: 02/02/2006, 13h03
  2. Pb pour afficher une page selon la résolution de l'écran
    Par magic8392 dans le forum Général JavaScript
    Réponses: 6
    Dernier message: 24/10/2005, 12h35
  3. Changer la résolution de l'écran
    Par Azharis dans le forum Windows
    Réponses: 2
    Dernier message: 14/10/2005, 20h41
  4. Etirer le bacground quelque soit la résolution de l'écran
    Par hikosaijuro dans le forum Balisage (X)HTML et validation W3C
    Réponses: 2
    Dernier message: 07/09/2005, 15h39
  5. recuperer la résolution de l'écran
    Par florent dans le forum C++Builder
    Réponses: 11
    Dernier message: 07/06/2002, 16h01

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo