Try this...
Dim LastR as long
LastR = Cells(Rows.Count, "P").End(xlUp).Select
ActiveSheet.PageSetup.PrintArea = "A1:P" & LastR

Signature
HTH...
Jim Thomlinson
> This snippet of code always fails on the ActiveSheet line
>
[quoted text clipped - 6 lines]
>
> Argh!!
ryguy7272 - 24 Jan 2008 22:51 GMT
Well, it certainly looks like it should work, but Excel doesn't like it. It
gtes hung up in the same place. What could it be?
Thanks,
Ryan--

Signature
RyGuy
> Try this...
>
[quoted text clipped - 13 lines]
> >
> > Argh!!
Dave Peterson - 24 Jan 2008 23:39 GMT
I don't think Jim saw that .Select lurking at the end of that second line:
Dim LastR as long
LastR = Cells(Rows.Count, "P").End(xlUp).Row '<--changed to row
ActiveSheet.PageSetup.PrintArea = "A1:P" & LastR
> Well, it certainly looks like it should work, but Excel doesn't like it. It
> gtes hung up in the same place. What could it be?
[quoted text clipped - 30 lines]
> > > --
> > > RyGuy

Signature
Dave Peterson
Jim Thomlinson - 24 Jan 2008 23:05 GMT
you want the row so get rid of the select...
Dim LastR as long
LastR = Cells(Rows.Count, "P").End(xlUp).Row 'Row not Select
ActiveSheet.PageSetup.PrintArea = "A1:P" & LastR

Signature
HTH...
Jim Thomlinson
> Try this...
>
[quoted text clipped - 13 lines]
> >
> > Argh!!
Dim LastR As Long
LastR = Cells(Rows.Count, "P").End(xlUp).Row
ActiveSheet.PageSetup.PrintArea = "$A$1:P" & LastR
Gord Dibben MS Excel MVP
>This snippet of code always fails on the ActiveSheet line
>
[quoted text clipped - 6 lines]
>
>Argh!!
ryguy7272 - 25 Jan 2008 14:21 GMT
I knew when Jim Thomlinson got involved this issue would be resolved!! Also,
thanks for the help Gord and Dave!! This must have been such a simple thing
for three gurus, but for me it was somewhat troublesome. Oh well, I learned
a new trick today.
Thanks again guys!
Ryan---

Signature
RyGuy
> Dim LastR As Long
> LastR = Cells(Rows.Count, "P").End(xlUp).Row
[quoted text clipped - 12 lines]
> >
> >Argh!!