Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a way to programaticlly determine the bottom right cell of the
worksheet print range when no print range has been declared. I've tried using UsedRange but it doesn't recognize Shape Objects. HPageBreaks and VPageBreaks tell me the top left but not the bottom right. Thanks. -- |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
From what I have been able to determine, the print area and the page break
have no relationship, except that the print area is contained within the page break areas. Perhaps if you were more elaborate in what you want to do, someone could offer a suggestion. "Rosie189" wrote: Is there a way to programaticlly determine the bottom right cell of the worksheet print range when no print range has been declared. I've tried using UsedRange but it doesn't recognize Shape Objects. HPageBreaks and VPageBreaks tell me the top left but not the bottom right. Thanks. -- |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi, Rosie !
Is there a way to programaticlly determine the bottom right cell of the worksheet print range when no print range has been declared. I've tried using UsedRange but it doesn't recognize Shape Objects. HPageBreaks and VPageBreaks tell me the top left but not the bottom right. Thanks. try a loop on your worksheet/s shapes collection (i.e.) Sub Print_Area_NO_Data() Dim n As Integer, mRow As Integer, mCol As Byte With ActiveSheet If .Shapes.Count = 0 Then Exit Sub If .PageSetup.PrintArea < "" Then Exit Sub mRow = .Shapes(1).BottomRightCell.Row mCol = .Shapes(1).BottomRightCell.Column For n = 2 To .Shapes.Count With .Shapes(n) If .BottomRightCell.Row mRow Then mRow = .BottomRightCell.Row If .BottomRightCell.Column mCol Then mCol = .BottomRightCell.Column End With Next End With MsgBox "Last printing cell is: " & Cells(mRow, mCol).Address End Sub hth, hector. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Héctor. I'll incorporate your routine.
JLGWhiz, Thank you for also responding. "Discussions" is such a great resource! -- "Héctor Miguel" wrote: hi, Rosie ! Is there a way to programaticlly determine the bottom right cell of the worksheet print range when no print range has been declared. I've tried using UsedRange but it doesn't recognize Shape Objects. HPageBreaks and VPageBreaks tell me the top left but not the bottom right. Thanks. try a loop on your worksheet/s shapes collection (i.e.) Sub Print_Area_NO_Data() Dim n As Integer, mRow As Integer, mCol As Byte With ActiveSheet If .Shapes.Count = 0 Then Exit Sub If .PageSetup.PrintArea < "" Then Exit Sub mRow = .Shapes(1).BottomRightCell.Row mCol = .Shapes(1).BottomRightCell.Column For n = 2 To .Shapes.Count With .Shapes(n) If .BottomRightCell.Row mRow Then mRow = .BottomRightCell.Row If .BottomRightCell.Column mCol Then mCol = .BottomRightCell.Column End With Next End With MsgBox "Last printing cell is: " & Cells(mRow, mCol).Address End Sub hth, hector. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Reference bottom left cell in a visible range | Excel Programming | |||
Find the bottom cell that contains a specific val in a range? | Excel Worksheet Functions | |||
bottom border every second cell in range | Excel Programming | |||
Finding the bottom non-blank cell in a range | Excel Discussion (Misc queries) | |||
how to print a row on the bottom of every page | Excel Discussion (Misc queries) |