LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Code Works for Some Worksheets, But Not Others

I have a macro which moves to each worksheet and changes the page setup
properties. The code changes the properties on some worksheets, but not
others.

Have anyone had a similar problem? Is the file corrupt? I have tried
- selecting all worksheets and changing the properties
- looping through each worksheet and changing the properties
Neither worked.

Code snippet:

Dim ws As Worksheet

For Each ws In Worksheets

If ws.Name = "Main" Then

With ws.PageSetup
.PrintQuality = 600
.FitToPagesWide = 1
.FitToPagesTall = False
End With

Else

With ws.PageSetup
.PrintQuality = 600
End With

End If

Next ws

 
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
Formula works on all worksheets except for 2 Jan Excel Worksheet Functions 3 March 30th 09 05:36 PM
Code somewhat works. Please help? jsc3489 Excel Programming 4 December 2nd 05 07:51 PM
Why this code works and other do not? Newbie here. [email protected] Excel Programming 2 September 10th 05 01:12 PM
Code works for any WBK except the PMW Mark Tangard[_3_] Excel Programming 3 July 17th 05 11:54 AM
Why won't this code works ksnapp[_37_] Excel Programming 6 April 1st 04 01:44 PM


All times are GMT +1. The time now is 10:55 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"