Sub test()
zooming_columns Range("A:AB")
End Sub
Function zooming_columns(rng As Variant)
Dim p_topx, marge#
Dim coeff#
With ActiveWindow
.Zoom = 100
p_topx = (.ActivePane.PointsToScreenPixelsX(72) - .ActivePane.PointsToScreenPixelsX(0)) / 72
marge = ((.ActivePane.PointsToScreenPixelsX(0) / p_topx) - Application.Left) * (1 + (Abs(ActiveWindow.DisplayVerticalScrollBar)))
If TypeName(rng) = "Range" Then
coeff = (Application.UsableWidth - marge) / rng.Width
.Zoom = 100 * coeff
Else
.Zoom = 100
End If
End With
[A1].Select
ActiveSheet.ScrollArea = "A1:AB77"
End Function