A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Macro "1 tall/1 wide" not working properly



 
 
Thread Tools Display Modes
  #1  
Old January 10th 05, 04:12 PM
gizmo
external usenet poster
 
Posts: n/a
Default Macro "1 tall/1 wide" not working properly

Hi guys,

I prepared the macro that should, among others, make the page fit 1 wide 1
tall.

Sub Landscape_full()
Application.ScreenUpdating = False
With ActiveSheet.PageSetup
.LeftFooter = ActiveWorkbook.FullName
.RightHeader = "&D" & Chr(10) & "&T"
.RightFooter = "&A"
.Orientation = xlLandscape
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
Application.ScreenUpdating = False
End Sub

However, something goes wrong here.
If I go to the "Page setup" command/"Page" tab, the "Fit to..." field is
changed to the correct values, but the active button stays still with
"Adjust to".
Do you have any idea what should be added to the code?

Thanks a lot,
Gizmo


Ads
  #3  
Old January 10th 05, 07:18 PM
Myrna Larson
external usenet poster
 
Posts: n/a
Default

Don's solution is what you want, but if you turn on the macro recorder, change
that setting back and forth, then compare the macros, you can see which
properties are changed when going from one mode to another.

Of course you get a lot of irrelevant lines, but you'll see that when you
click the upper radio button, .Zoom = 100 is added and there are no .FitTo...
lines; when you click the bottom one, the code includes .Zoom = False and the
..FitTo... lines.


On Mon, 10 Jan 2005 17:12:53 +0100, "gizmo" > wrote:

>Hi guys,
>
>I prepared the macro that should, among others, make the page fit 1 wide 1
>tall.
>
>Sub Landscape_full()
> Application.ScreenUpdating = False
>With ActiveSheet.PageSetup
> .LeftFooter = ActiveWorkbook.FullName
> .RightHeader = "&D" & Chr(10) & "&T"
> .RightFooter = "&A"
> .Orientation = xlLandscape
> .FitToPagesWide = 1
> .FitToPagesTall = 1
>End With
> Application.ScreenUpdating = False
>End Sub
>
>However, something goes wrong here.
>If I go to the "Page setup" command/"Page" tab, the "Fit to..." field is
>changed to the correct values, but the active button stays still with
>"Adjust to".
>Do you have any idea what should be added to the code?
>
>Thanks a lot,
>Gizmo
>


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
"Compare2Lists" Macro Not working B Schwarz Excel Discussion (Misc queries) 3 January 7th 05 11:35 PM
Macro not working with Excel 2003 Fernando Gomez Excel Discussion (Misc queries) 1 December 16th 04 12:19 AM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM
Macro for multiple charts JS Excel Worksheet Functions 1 November 19th 04 03:44 AM
Replace function not working properly in Excel 2000 SP3 rgbytg Excel Worksheet Functions 5 November 11th 04 03:44 PM


All times are GMT +1. The time now is 02:44 PM.


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