Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Setting Print Area, includes text, numbers, charts & graphs

Well, it seems to have worked. It's too bad that the method of hiding
unused rows & columns didnt work (it misses objects/charts, etc),
because that REALLY cut down on wasted space & page count.

Oh well, ya cant have everything.

Thanks for the help though!

~arawn


Dave Peterson wrote in message ...
What happens if you just reset the last cell, then reset the print range (not
specifying the address at all)?

Option Explicit
Sub testme01()

'Dim strLCell As String

With ActiveSheet
.UsedRange
'reset last cell
'strLCell = .Cells.SpecialCells(xlCellTypeLastCell).Address
'get last cell address
.PageSetup.PrintArea = ""
'set the print area
End With

End Sub

Arawn wrote:

I need to set print areas on Excel sheets automatically. I will never
know what a sheet will contain, but I do need to be able to set the
print areas.

I have tried a variety of methods, but have not had the desired
results:

With ActiveSheet
.UsedRange
'reset last cell
strLCell = .Cells.SpecialCells(xlCellTypeLastCell).Address
'get last cell address
.PageSetup.PrintArea = "$A$1:" & strLCell
'set the print area
End With

This method doesn't recognize charts/graphs/objects apparently.

I also tried hiding unused columns/rows (as described on J-Walk.com)
but that didnt seem to work either.

Any help would be appreciated.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default Setting Print Area, includes text, numbers, charts & graphs

Arawm,

One way to capture the charts (if they are embedded on the worksheet) is to
go to the cell under the lower right corner of the chart and enter a space
(using the spacebar). Now Excel will see that cell as part of your used
area and include it in
strLCell = .Cells.SpecialCells(xlCellTypeLastCell).Address

--
sb
"Arawn" wrote in message
om...
Well, it seems to have worked. It's too bad that the method of hiding
unused rows & columns didnt work (it misses objects/charts, etc),
because that REALLY cut down on wasted space & page count.

Oh well, ya cant have everything.

Thanks for the help though!

~arawn


Dave Peterson wrote in message

...
What happens if you just reset the last cell, then reset the print range

(not
specifying the address at all)?

Option Explicit
Sub testme01()

'Dim strLCell As String

With ActiveSheet
.UsedRange
'reset last cell
'strLCell = .Cells.SpecialCells(xlCellTypeLastCell).Address
'get last cell address
.PageSetup.PrintArea = ""
'set the print area
End With

End Sub

Arawn wrote:

I need to set print areas on Excel sheets automatically. I will never
know what a sheet will contain, but I do need to be able to set the
print areas.

I have tried a variety of methods, but have not had the desired
results:

With ActiveSheet
.UsedRange
'reset last cell
strLCell = .Cells.SpecialCells(xlCellTypeLastCell).Address
'get last cell address
.PageSetup.PrintArea = "$A$1:" & strLCell
'set the print area
End With

This method doesn't recognize charts/graphs/objects apparently.

I also tried hiding unused columns/rows (as described on J-Walk.com)
but that didnt seem to work either.

Any help would be appreciated.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Setting Print Area, includes text, numbers, charts & graphs

Is there a way to do this automatically from within a macro? I am
opening hundreds of worksheets in sequence, but I never know what is
going to be in them.

Any assistance would be appreciated.

~arawn

"steve" wrote in message ...
Arawm,

One way to capture the charts (if they are embedded on the worksheet) is to
go to the cell under the lower right corner of the chart and enter a space
(using the spacebar). Now Excel will see that cell as part of your used
area and include it in
strLCell = .Cells.SpecialCells(xlCellTypeLastCell).Address

--
sb
"Arawn" wrote in message
om...
Well, it seems to have worked. It's too bad that the method of hiding
unused rows & columns didnt work (it misses objects/charts, etc),
because that REALLY cut down on wasted space & page count.

Oh well, ya cant have everything.

Thanks for the help though!

~arawn


Dave Peterson wrote in message

...
What happens if you just reset the last cell, then reset the print range

(not
specifying the address at all)?

Option Explicit
Sub testme01()

'Dim strLCell As String

With ActiveSheet
.UsedRange
'reset last cell
'strLCell = .Cells.SpecialCells(xlCellTypeLastCell).Address
'get last cell address
.PageSetup.PrintArea = ""
'set the print area
End With

End Sub

Arawn wrote:

I need to set print areas on Excel sheets automatically. I will never
know what a sheet will contain, but I do need to be able to set the
print areas.

I have tried a variety of methods, but have not had the desired
results:

With ActiveSheet
.UsedRange
'reset last cell
strLCell = .Cells.SpecialCells(xlCellTypeLastCell).Address
'get last cell address
.PageSetup.PrintArea = "$A$1:" & strLCell
'set the print area
End With

This method doesn't recognize charts/graphs/objects apparently.

I also tried hiding unused columns/rows (as described on J-Walk.com)
but that didnt seem to work either.

Any help would be appreciated.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Setting Print Area, includes text, numbers, charts & graphs

I don't like putting spaces into empty cells. But I have used formulas like
="".

It looks empty, but isn't. And I hope that when I look at that cell, I'll
remember why I did it.

Option Explicit
Sub testme()

Dim myShape As Shape
Dim wks As Worksheet

For Each wks In ActiveWorkbook.Worksheets
With wks
For Each myShape In .Shapes
With myShape
If IsEmpty(.BottomRightCell) Then
.BottomRightCell.Formula = "="""""
End If
End With
Next myShape
End With
Next wks

End Sub

You could look for the bottom-most and right-most, but why not just plop those
formulas whenever the cell is empty?

Arawn wrote:

Is there a way to do this automatically from within a macro? I am
opening hundreds of worksheets in sequence, but I never know what is
going to be in them.

Any assistance would be appreciated.

~arawn

"steve" wrote in message ...
Arawm,

One way to capture the charts (if they are embedded on the worksheet) is to
go to the cell under the lower right corner of the chart and enter a space
(using the spacebar). Now Excel will see that cell as part of your used
area and include it in
strLCell = .Cells.SpecialCells(xlCellTypeLastCell).Address

--
sb
"Arawn" wrote in message
om...
Well, it seems to have worked. It's too bad that the method of hiding
unused rows & columns didnt work (it misses objects/charts, etc),
because that REALLY cut down on wasted space & page count.

Oh well, ya cant have everything.

Thanks for the help though!

~arawn


Dave Peterson wrote in message

...
What happens if you just reset the last cell, then reset the print range

(not
specifying the address at all)?

Option Explicit
Sub testme01()

'Dim strLCell As String

With ActiveSheet
.UsedRange
'reset last cell
'strLCell = .Cells.SpecialCells(xlCellTypeLastCell).Address
'get last cell address
.PageSetup.PrintArea = ""
'set the print area
End With

End Sub

Arawn wrote:

I need to set print areas on Excel sheets automatically. I will never
know what a sheet will contain, but I do need to be able to set the
print areas.

I have tried a variety of methods, but have not had the desired
results:

With ActiveSheet
.UsedRange
'reset last cell
strLCell = .Cells.SpecialCells(xlCellTypeLastCell).Address
'get last cell address
.PageSetup.PrintArea = "$A$1:" & strLCell
'set the print area
End With

This method doesn't recognize charts/graphs/objects apparently.

I also tried hiding unused columns/rows (as described on J-Walk.com)
but that didnt seem to work either.

Any help would be appreciated.


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Print Area Setting RozBuds Excel Discussion (Misc queries) 3 February 19th 10 09:41 PM
Setting The Print-Area ? Robert11[_3_] New Users to Excel 2 May 31st 09 03:24 PM
Charts - Setting Data Area as a Variable JohnG Charts and Charting in Excel 1 April 28th 09 09:58 AM
Setting print area richzip Excel Discussion (Misc queries) 1 April 27th 08 08:10 AM
setting complex print area Myrna Larson[_2_] Excel Programming 3 August 18th 03 04:37 PM


All times are GMT +1. The time now is 06:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"