View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sami82[_25_] Sami82[_25_] is offline
external usenet poster
 
Posts: 1
Default Variable Print Range


Hi All,

I am writing a small piece of some very large code and I have come
across a glitch. In this one piece I set the print ranges for each
sheet:

Worksheets("NamedSheet1").Activate
Worksheets("NamedSheet1").PageSetup.PrintArea = Range("A1",
Range("I65536").End(xlUp))
Worksheets("NamedSheet1").PageSetup.CenterHorizont ally = True
Worksheets("NamedSheet2").Activate
Worksheets("NamedSheet2").PageSetup.PrintArea = Range("B1",
Range("J65536").End(xlUp))
Worksheets("NamedSheet2").PageSetup.CenterHorizont ally = True
Worksheets("NamedSheet3").Activate
Worksheets("NamedSheet3").PageSetup.PrintArea = Range("A1",
Range("I65536").End(xlUp))
Worksheets("NamedSheet3").PageSetup.CenterHorizont ally = True

Error: 1004 Unable to set the PrintArea property of the pagesetup
class.


But it doesnt seem to like the second or third times.

Can anyone help me? Thank you


--
Sami82
------------------------------------------------------------------------
Sami82's Profile: http://www.excelforum.com/member.php...o&userid=27111
View this thread: http://www.excelforum.com/showthread...hreadid=509624