Best fit

S

skitek

hi guys,

I've got a little problem with code for auto fit (or any other ) t
screen size. What I intend to do is to make single worksheet focused o
specific range every time user activates the worksheet.
thx for help


tit
 
J

Jim May

example applicable to say sheet3:

Off Sheet3 in VBE copy:

Private Sub Worksheet_Activate()
Application.Goto Range("g12"), True
End Sub

Will that do?
 
S

skitek

skitek said:
*hi guys,

I've got a little problem with code for auto fit (or any other ) t
screen size. What I intend to do is to make single worksheet focuse
on specific range every time user activates the worksheet.
thx for help


tito *

I guess not. I thought about creating selffocusing worksheet activat
function. Would you please give me a sample of code which would allo
me to make a printarea range fit to the screen so that only this are
would be visible and user wouls see only this part of worksheet

th
 
T

Tom Ogilvy

Private Sub Worksheet_Activate()
Dim rng As Range
Set rng = Selection
Range("A1:M20").Select
ActiveWindow.Zoom = True
If Union(ActiveWindow.VisibleRange, rng).Address = _
ActiveWindow.VisibleRange.Address Then
rng.Select
Else
Range("A1").Select
End If
End Sub
 
Top