Best fit

  • Thread starter Thread starter skitek
  • Start date Start date
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
 
example applicable to say sheet3:

Off Sheet3 in VBE copy:

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

Will that do?
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top