|
|
|
|
|
|
Excel
|
Change page setup (and printers) with userform interface
|
|
Ease of Use
|
Intermediate
|
Version tested with
|
2000, 2003
|
Submitted by:
|
mdmackillop
|
Description:
|
Simple userform to change paper size and orientation to suit your spreadsheet.
Changing printers in a network situation reqires additional code which can be found here
http://www.vbaexpress.com/kb/getarticle.php?kb_id=528
|
Discussion:
|
If you have access to different paper sizes, this userform lets you switch easily between the options and preview the results.
|
Code:
|
instructions for use
|
Option Explicit
Sub ShowPageSetUp()
PageSetUp.Show False
End Sub
|
How to use:
|
- Open an the example Excel workbook
- Select Tools/Macro/Visual Basic Editor
- In the VBE window, select VBAProject(Personal.xls)
- Select Insert/Module
- Copy and paste the code above into the Module
- Drag the PageSetup userform from PageSetup to Personal.xls
- Now select File/Close and Return To Microsoft Excel
- Create a shortcut to run ShowPageSetup
- Save the workbook
|
Test the code:
|
- Open the userform
- Change the settings
- Open File/PageSetup and the new settings should be reflected there
- or
- Preview/Print with the new settings
|
Sample File:
|
PageSetup.zip 62.7KB
|
Approved by mdmackillop
|
This entry has been viewed 276 times.
|
|