Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Mar 2001
    Location
    San Clemente, California, USA
    Posts
    130
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Page Setup in VBA (1 Page) (Excel 97)

    Hi There,

    To automate some formatting I have to do to ALOT of worksheets I have the following code:

    Cells.Select
    With Selection
    .WrapText = False
    .MergeCells = False
    End With
    With ActiveSheet.PageSetup
    .FitToPagesWide = 1
    .FitToPagesTall = 1
    End With

    This code is attached to a button on the toolbar. It should unwrap & unmerge all fields and set the page setup to 1 page.

    It does the unwrap & unmerge just fine, but the page setup part isn't working.

    What I noticed is that unless the radio button for 'Fit to" is already selected this will not do anything.

    What I guess I really need to do is select the option for 1 page by 1 page.

    How do I do this?

    Thanks!

  2. #2
    2 Star Lounger
    Join Date
    Mar 2001
    Location
    San Clemente, California, USA
    Posts
    130
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Page Setup in VBA (1 Page) (Excel 97)

    OK, I think I just solved my own problem.

    I took a look at the original code (down through recording a macro) and started commenting out lines one-by-one. It continued to work until I commented out

    .zoom=false

    So by keeping in the .zoom = false my code works to set my page to print the way I want it..

    Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •