Pestomania
Active Member
- Joined
- May 30, 2018
- Messages
- 330
- Office Version
- 365
- Platform
- Windows
Hi! I am trying to determine the "white space" between the last used row and the last row in print area. I currently have this to determine last used row and it works, but can't determine last row in print area.
Can someone help me determine x and y to keep the shape from going outside the print area?
Code:
Sub cover()
Dim lastrow as long
Dim top as string
Lastrow = range("A" & rows.count).End(xlUp).offset(1).row
Top =Range ("A" & lastrow).top
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 0, top, x, y)
End sub
Can someone help me determine x and y to keep the shape from going outside the print area?