I have an Excel 2003 macro to adjust my screen zoom based on the screen resolution.
Sub Macro1()
Dim maxWidth As Long, myWidth As Long
Dim myZoom As Single
maxWidth = Application.UsableWidth * 0.96
'I use r because upto r i have macro buttons
myWidth = ThisWorkbook.ActiveSheet.Range("r1").Left
myZoom = maxWidth / myWidth
ActiveWindow.Zoom = myZoom * 100
End Sub
When I try in Excel 2003, button size & its caption are not zooming properly.
And Application.UsableWidth
is always returning 1026
as width for either the screen resolution 1024*768 or 1366*768. Any ideas?
I want the Excel sheet to be fit in width if open in any system screen resolution
See Question&Answers more detail:os