Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Can a macro be written that when you open a workbook the zoom will be set for each sheet?

Marc


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Can a macro be written that when you open a workbook the zoom will be set for each sheet?

maybe something like this in a code module

Option Explicit

Dim sheet As Worksheet
Sub Auto_Open()
For Each sheet In ThisWorkbook.Worksheets
sheet.Activate
ActiveWindow.Zoom = 200
Next
End Sub

--


Gary


"Marc" wrote in message
. net...
Marc




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can a macro be written that when you open a workbook the zoom will be set for each sheet?


Yes.

In Microsoft Visual Basic Editor, under ObjectsThisWorkbook, input th
following code:

Private Sub Workbook_Open()
For Each ws In Worksheets
ws.select
ActiveWindow.Zoom = 100
Next
End Sub

Change the zoom to whatever zoom you want it to be. do not include th
% symbo

--
dok11
-----------------------------------------------------------------------
dok112's Profile: http://www.excelforum.com/member.php...fo&userid=1058
View this thread: http://www.excelforum.com/showthread.php?threadid=53016

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Can a macro be written that when you open a workbook the zoom will be set for each sheet?

Spoke to soon. I copied it and change the 100 to 75 and tried to run it and
I get a run time error '1004' "Select method of Worksheet class failed".

Marc

"dok112" wrote in
message ...

Yes.

In Microsoft Visual Basic Editor, under ObjectsThisWorkbook, input the
following code:

Private Sub Workbook_Open()
For Each ws In Worksheets
ws.select
ActiveWindow.Zoom = 100
Next
End Sub

Change the zoom to whatever zoom you want it to be. do not include the
% symbol


--
dok112
------------------------------------------------------------------------
dok112's Profile:

http://www.excelforum.com/member.php...o&userid=10581
View this thread: http://www.excelforum.com/showthread...hreadid=530168



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can a macro be written that when you open a workbook the zoom will be set for each sheet?


You will get that error if you have put the code in the wrong spot, or
if you are attempting to make the zoom too large. You can go from 10
to 400 percent. If you put that code in a regular module, you will get
that error. It has to go into the ThisWorkbook object so it knows to do
it when it opens.

Marc Wrote:
Spoke to soon. I copied it and change the 100 to 75 and tried to run it
and
I get a run time error '1004' "Select method of Worksheet class
failed".

Marc

"dok112" wrote
in
message ...

Yes.

In Microsoft Visual Basic Editor, under ObjectsThisWorkbook, input

the
following code:

Private Sub Workbook_Open()
For Each ws In Worksheets
ws.select
ActiveWindow.Zoom = 100
Next
End Sub

Change the zoom to whatever zoom you want it to be. do not include

the
% symbol


--
dok112

------------------------------------------------------------------------
dok112's Profile:

http://www.excelforum.com/member.php...o&userid=10581
View this thread:

http://www.excelforum.com/showthread...hreadid=530168



--
dok112
------------------------------------------------------------------------
dok112's Profile: http://www.excelforum.com/member.php...o&userid=10581
View this thread: http://www.excelforum.com/showthread...hreadid=530168



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Can a macro be written that when you open a workbook the zoom will be set for each sheet?

Thanks I get tired of have to do each sheet manually.

Marc

"Marc" wrote in message
. net...
Marc




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
open to a certain sheet tab in a different workbook akay71 New Users to Excel 1 June 5th 08 05:01 PM
Search open sheets in workbook and insert into open sheet punx77 Excel Discussion (Misc queries) 0 March 6th 06 05:07 PM
Open workbook at a particular sheet George Gee New Users to Excel 2 October 15th 05 12:54 PM
excel - macro code to open a protected sheet, enter passowrd, and then protect sheet arunjoshi[_5_] Excel Programming 1 May 2nd 04 03:50 PM
open sheet on workbook open Stu[_31_] Excel Programming 4 October 20th 03 01:38 AM


All times are GMT +1. The time now is 04:11 AM.

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

About Us

"It's about Microsoft Excel"