Share via


PointsToScreenPixelsY Method

Returns a Long value that represents the number of pixels from the top edge of the spreadsheet's window to the top edge of the first row in the spreadsheet, plus the value specified in the Points argument.

expression.PointsToScreenPixelsY(Points)

*expression   * Required. An expression that returns a Window object.

Points   Required Long. The number of pixels to add to this method's result.

Remarks

Although the name of this method suggests that it will convert point values to screen pixel values, it actually performs the action described above using only pixel values. For the PointsToScreenPixelsY method, this value will vary depending on whether the toolbar (22 pixels) and column headers (17 pixels) are turned on.

Example

This example returns 40 when both the toolbar and column headers are turned on, and returns 1 when the toolbar and column headers are turned off.

Sub Window_OnLoad()

     MsgBox Spreadsheet1.ActiveWindow.PointsToScreenPixelsY(0)   

End Sub

Applies to | Window Object

See Also | PointsToScreenPixelsX Method