LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Calculate vertical midpoint of a print area in a sheet

This will work if :-
1. There is only 1 page.
2. The Print Range is set (or you can supply another range)

'----------------------------------------------------
Sub test()
'- requires that Print area is set
Dim TotalRowHeight As Long
Dim PictureHeight As Long
'-- calculate height
TotalRowHeight = 0
For Each RW In ActiveSheet.Range("Print_Area").Rows
TotalRowHeight = TotalRowHeight + RW.RowHeight
Next
'- change picture position
PictureHeight = ActiveSheet.OLEObjects("Object 1").Height
ActiveSheet.OLEObjects("Object 1").Top = (TotalRowHeight / 2)
(PictureHeight / 2)
End Sub
'--------------------------------------------

--
Message posted from http://www.ExcelForum.com

 
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
Repeating gradient for each vertical area of plot area Steve Vincent Charts and Charting in Excel 3 October 27th 09 11:25 PM
How do I set a print area for every sheet in the workbook? scru_ball Excel Discussion (Misc queries) 3 February 3rd 09 11:59 PM
How do I calculate the midpoint date between two dates. Allan Excel Worksheet Functions 3 May 12th 06 03:49 PM
Active cell counting in particular print page (one sheet having different print area) ananthmca2004 Excel Worksheet Functions 1 November 24th 05 11:29 AM
Print a sheet area to another... Mike Excel Discussion (Misc queries) 5 July 8th 05 09:05 PM


All times are GMT +1. The time now is 11:42 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"