Oui celui-ci je l'avais vu aussi mais j'ai erreur à ce niveau
Declare PtrSafe Function GetSystemMetrics32 Lib "User32" _
Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long
et je ne sais pas l'adapter pour mon Excel
merci
mais pour usf j'ai trouvé ceci:
mettre un call
call AdapterTailleFormAEcran 'dans UserForm_initialize()
Sub AdapterTailleFormAEcran() ' ------ ******** pour adapter USF à d'autres écrans *******----------
'par Excel-Malin.com ( https://excel-malin.com )
'Application.WindowState = xlMaximized
If ActiveWindow.Width > Me.Width And ActiveWindow.Height > Me.Height Then Exit Sub
If (Round((ActiveWindow.Width * 0.95) / Me.Width, 2) * 100) - 1 < (Round((ActiveWindow.Height * 0.95) / Me.Height, 2) * 100) - 1 Then
Me.Zoom = (Round((ActiveWindow.Width * 0.95) / Me.Width, 2) * 100) - 1
Me.Width = Me.Width * Me.Zoom / 100
Me.Height = Me.Height * Me.Zoom / 100
Else
Me.Zoom = (Round((ActiveWindow.Height * 0.95) / Me.Height, 2) * 100) - 1
Me.Width = Me.Width * Me.Zoom / 100
Me.Height = Me.Height * Me.Zoom / 100
End If
End Sub
J'ai essayé sur mon mini pc pour la USF c'est au top, mais pas pour les feuilles excel..... faut jouer de la flêche haut et bas... c'est la galère
En fait c'est la dimension de l'écran qui faut trouver pour l'adapter en général
merci bien