Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Zoom via Macro for WorkSheet to activate?


Hi,

I have more worksheet in the workboock.
I wish the Application in another PC - wiht different
Monitor-resolution to opening. However in the sam
workSheet-largeness.

A.) Automatlically?

B.) Via macro (Button) in the defined Zoom, for all workSheet t
activate?

Have I any cance?
Thank you very much!
Werga

--
freni
-----------------------------------------------------------------------
frenic's Profile: http://www.excelforum.com/member.php...fo&userid=2529
View this thread: http://www.excelforum.com/showthread.php?threadid=38787

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default Zoom via Macro for WorkSheet to activate?

Hi Wergan,

I have placed a macro below that should hopefully do what you need. I
use the Zoom - Fit Selection functionality of Excel. (There are other
ways to achieve what you're doing but I think this is the simplest - you
don't need to check screen resolution this way.)

In this example I have assumed you want to be able to see columns 15.

If you assign this to a button then it will run whenever clicked, on the
activesheet. Alternatively, if you want it to run upon opening, you
should place a call to it in the Workbook_OPen event in ThisWorkbook,
having first made sure that the worksheet you need to work on is active.

HTH,
Gareth

Sub ZoomHowIWantIt()

Dim PreviousSelection As Range
Dim blnEventsEnabled As Boolean

With ActiveSheet
'Remember what was previously selected
Set PreviousSelection = Selection

Application.ScreenUpdating = False
blnEventsEnabled = Application.EnableEvents
Application.EnableEvents = False

'Set the range you want to be in the activewindow.
'I'm assuming you're more concerned about columns
'than rows
Range(.Columns(1), .Columns(5)).Select
ActiveWindow.Zoom = True
'return to previous selection
PreviousSelection.Select
Application.EnableEvents = blnEventsEnabled

End With

Set PreviousSelection = Nothing
Application.ScreenUpdating = True

End Sub


frenic wrote:
Hi,

I have more worksheet in the workboock.
I wish the Application in another PC - wiht different
Monitor-resolution to opening. However in the same
workSheet-largeness.

A.) Automatlically?

B.) Via macro (Button) in the defined Zoom, for all workSheet to
activate?

Have I any cance?
Thank you very much!
Wergan


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling a macro from Worksheet--Activate Fatz Excel Discussion (Misc queries) 3 March 5th 08 11:07 PM
Worksheet- activate macro sarah Excel Discussion (Misc queries) 3 March 21st 07 04:44 PM
Setting zoom of a worksheet in macro jhartley Excel Programming 3 May 13th 04 04:26 AM
Run Macro on Worksheet Activate Matthew John Antoszkiw Excel Programming 2 February 23rd 04 12:01 PM
Setting zoom for all worksheet pages don lloyd Excel Programming 1 July 17th 03 01:40 AM


All times are GMT +1. The time now is 10:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"