ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   print area mising last row (https://www.excelbanter.com/excel-programming/278602-re-print-area-mising-last-row.html)

Tom Ogilvy

print area mising last row
 
Assume there is a blank cell in column A within your data?

ActiveSheet.PageSetup.PrintArea = "=OFFSET(A1,,,COUNTA(A:A)+1,11)"

Other than that
set rng = Range(cells(1,1),cells(rows.count,1).End(xlup))
ActiveSheet.PageSetup.PrintArea = rng.Resize(,11).Address(external:=True)

you would need to rerun the macro each time the range changed.

--
Regards,
Tom Ogilvy

"Christy" wrote in message
...
Hi all,

I have following code to set the printarea for a
worksheet. It works but falls one row short of getting
the used data. How can I adjust to fix that?

In case I have not said it lately, what a GREAT site this
is and thanks to all of you who help our struggling!

Christy ;)


If ActiveSheet.Name = "LogReport" Then
ActiveSheet.PageSetup.PrintArea = "=OFFSET(A1,,,COUNTA
(A:A),11)" 'gets active data through column 11
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.PaperSize = xlPaperLetter
.Zoom = 100
End With
ActiveWindow.SelectedSheets.PrintPreview
End If




Tom Ogilvy

print area mising last row
 
Commandbars("Full Screen").Visible = False

Untested, but I believe that should do it.

I understand there can be problems if the user minimizes the full screen
display and then maximizes it. You might search goolge groups for a
discussion of this.

http://groups.google.com/advanced_group_search?hl=en

use Microsoft.public.excel.programming as the workgroup.

--
Regards,
Tom Ogilvy


"Christy" wrote in message
...
Right again Tom, there is a blank cell in column A. What
would I do without you?

I do have another question if you would be so kind. I am
using full screen to get rid of the toolbars. When I run
this in 97 I get a pesky floating toolbar to toggle out
of full screen. How can I keep that from showing up?

Christy
-----Original Message-----
Assume there is a blank cell in column A within your

data?

ActiveSheet.PageSetup.PrintArea = "=OFFSET(A1,,,COUNTA

(A:A)+1,11)"

Other than that
set rng = Range(cells(1,1),cells(rows.count,1).End

(xlup))
ActiveSheet.PageSetup.PrintArea = rng.Resize

(,11).Address(external:=True)

you would need to rerun the macro each time the range

changed.

--
Regards,
Tom Ogilvy

"Christy" wrote in message
...
Hi all,

I have following code to set the printarea for a
worksheet. It works but falls one row short of getting
the used data. How can I adjust to fix that?

In case I have not said it lately, what a GREAT site

this
is and thanks to all of you who help our struggling!

Christy ;)


If ActiveSheet.Name = "LogReport" Then
ActiveSheet.PageSetup.PrintArea = "=OFFSET

(A1,,,COUNTA
(A:A),11)" 'gets active data through column 11
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.PaperSize = xlPaperLetter
.Zoom = 100
End With
ActiveWindow.SelectedSheets.PrintPreview
End If



.




Christy[_4_]

print area mising last row
 
Thank you very much, I will check it out.

Christy

-----Original Message-----
Commandbars("Full Screen").Visible = False

Untested, but I believe that should do it.

I understand there can be problems if the user minimizes

the full screen
display and then maximizes it. You might search goolge

groups for a
discussion of this.

http://groups.google.com/advanced_group_search?hl=en

use Microsoft.public.excel.programming as the

workgroup.

--
Regards,
Tom Ogilvy


"Christy" wrote in message
...
Right again Tom, there is a blank cell in column A.

What
would I do without you?

I do have another question if you would be so kind. I

am
using full screen to get rid of the toolbars. When I

run
this in 97 I get a pesky floating toolbar to toggle out
of full screen. How can I keep that from showing up?

Christy
-----Original Message-----
Assume there is a blank cell in column A within your

data?

ActiveSheet.PageSetup.PrintArea = "=OFFSET

(A1,,,COUNTA
(A:A)+1,11)"

Other than that
set rng = Range(cells(1,1),cells(rows.count,1).End

(xlup))
ActiveSheet.PageSetup.PrintArea = rng.Resize

(,11).Address(external:=True)

you would need to rerun the macro each time the range

changed.

--
Regards,
Tom Ogilvy

"Christy" wrote in message
...
Hi all,

I have following code to set the printarea for a
worksheet. It works but falls one row short of

getting
the used data. How can I adjust to fix that?

In case I have not said it lately, what a GREAT site

this
is and thanks to all of you who help our struggling!

Christy ;)


If ActiveSheet.Name = "LogReport" Then
ActiveSheet.PageSetup.PrintArea = "=OFFSET

(A1,,,COUNTA
(A:A),11)" 'gets active data through column 11
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.PaperSize = xlPaperLetter
.Zoom = 100
End With
ActiveWindow.SelectedSheets.PrintPreview
End If


.



.



All times are GMT +1. The time now is 04:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com