hmk
Active Member
- Joined
- Jun 8, 2004
- Messages
- 423
How to use this code of Pearson and where to put it exactuly
Code:
Sub ZoomToRange(ByVal ZoomThisRange As Range, _
ByVal PreserveRows As Boolean)
Dim Wind As Window
Set Wind = ActiveWindow
Application.ScreenUpdating = False
'
' Put the upper left cell of the range in the top-left of the screen.
'Application.Goto ZoomThisRange(1, 1), True
ZoomToRange ZoomThisRange:=Range("F20:K40"), PreserveRows:=True
With ZoomThisRange
If PreserveRows = True Then
.Resize(.Rows.Count, 1).Select
Else
.Resize(1, .Columns.Count).Select
End If
End With
With Wind
.Zoom = True
.VisibleRange(1, 1).Select
End With
End Sub