Page Setup in Excel 2003 using VBA

I can get as far as bringing up the print preview screen using VBA. How do I then get VBA to squeeze my spreadsheet onto one page before printing. There is probably a simple solution out there but I'm currently teaching myself VBA by trial and error... but my boss seems to think I know what I'm doing!!!

Answer this question

Page Setup in Excel 2003 using VBA

  • kinpin9

    Assuming all the data you want to print on a single page exists on Sheet1:

    Sheet1.PageSetup.Zoom = False
    Sheet1.PageSetup.FitToPagesTall = 1
    Sheet1.PageSetup.FitToPagesWide = 1

    That should do it. (I won't tell your boss if you don't!)



  • Page Setup in Excel 2003 using VBA