ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Best fit (https://www.excelbanter.com/excel-programming/308610-best-fit.html)

skitek[_2_]

Best fit
 
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

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


Jim May

Best fit
 
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 " 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/




skitek[_3_]

Best fit
 
skitek wrote:
*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

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


Tom Ogilvy

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/





All times are GMT +1. The time now is 09:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com