Thread: Best fit
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Best fit

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


--
Regards,
Tom Ogilvy

"skitek " wrote in message
...
hi guys,

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


tito


---
Message posted from http://www.ExcelForum.com/