View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Setting Print range

ActiveSheet.PageSetup.PrintArea = _
Range("A1").CurrentRegion.Address(external:=true)

Put it in the BeforePrint event.

Regards,
Tom Ogilvy



Brad E wrote in message
...
Thanks Tom.

I forgot one thing though: I have a protected SUM formula
in the last column to keep a running sum as data is
entered. =IF(data is entered in column A, SUM, ""). So
upon printing, Excel prints all 200 lines thinking the ""
is printable.

-----Original Message-----
If you don't set the printarea, then excel will just

print the used area.

the message depends on the security setting. If you want

to increase the
chances of opening a document with a virus, you can lower

the security
setting and not be prompted. This has to be done by each

individual user.

Regards,
Tom Ogilvy

"Brad E" wrote in message
...
I am creating a worksheet where the number of entries

can
be anywhere from 1 - 200. Each entry is on a new row.

I
don't want to set the print range to print all 200 rows
before I save this spreadsheet for the rest of the
department to use. If a user has only entered three

lines
of data, there is no reason to waste paper by printing

all
200 lines.

Is there a macro I could use to define the print range?

Also, if I enter a macro, is there any way to open the
workbook without having to click "yes: after the
message, "This document contains macros, do you want to
continue?"

Thanks, Brad E.