View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Kilmer Bob Kilmer is offline
external usenet poster
 
Posts: 280
Default Help. Excel Printing Macro

Suggestion: Record a macro while setting the print area, then examine and
adapt the code. You'll get something like this:

ActiveSheet.PageSetup.PrintArea = "$B$1:$B$36"

To be specific about which workbook and worksheet you are setting the print
area for, you might use

Workbooks("Book1.xls").Worksheets("Sheet1").PageSe tup.PrintArea =
"$B$1:$B$36"

where you replace Book1.xls and Sheet1 with your own workbook and sheet
names.

"$B$1:$B$36" can be replaced with any statement that returns a range
address; e.g., Range(Cells(1,1),Cells(2,2)).Address

Regards,
Bob


"wmcray " wrote in message
...
Hello,

I have an Excel worksheet which has three pages of data and the rest of
the pages are blank.

Upon printing, a lot of blank pages will be printed.

Could anyone please instruct me how to write an Excel macro to control
the page or print setting so that blank pages will not be printed?

Thank you!!

Jason


---
Message posted from http://www.ExcelForum.com/