Skip to content

Latest commit

 

History

History
59 lines (41 loc) · 2.22 KB

Excel.ShapeRange.ScaleHeight.md

File metadata and controls

59 lines (41 loc) · 2.22 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
ShapeRange.ScaleHeight method (Excel)
vbaxl10.chm640090
vbaxl10.chm640090
Excel.ShapeRange.ScaleHeight
93687481-8c24-d002-19de-1b60cdfade06
05/14/2019
medium

ShapeRange.ScaleHeight method (Excel)

Scales the height of the shape by a specified factor. For pictures and OLE objects, you can indicate whether you want to scale the shape relative to the original or the current size. Shapes other than pictures and OLE objects are always scaled relative to their current height.

Syntax

expression.ScaleHeight (Factor, RelativeToOriginalSize, Scale)

expression A variable that represents a ShapeRange object.

Parameters

Name Required/Optional Data type Description
Factor Required Single Specifies the ratio between the height of the shape after you resize it and the current or original height. For example, to make a rectangle 50 percent larger, specify 1.5 for this argument.
RelativeToOriginalSize Required MsoTriState msoTrue to scale the shape relative to its original size. msoFalse to scale it relative to its current size. You can specify msoTrue for this argument only if the specified shape is a picture or an OLE object.
Scale Optional Variant One of the constants of MsoScaleFrom, which specifies which part of the shape retains its position when the shape is scaled.

Example

This example scales all pictures and OLE objects on myDocument to 175 percent of their original height and width, and it scales all other shapes to 175 percent of their current height and width.

Set myDocument = Worksheets(1) 
For Each s In myDocument.Shapes 
    Select Case s.Type 
    Case msoEmbeddedOLEObject, _ 
            msoLinkedOLEObject, _ 
            msoOLEControlObject, _ 
            msoLinkedPicture, msoPicture 
        s.ScaleHeight 1.75, msoTrue 
        s.ScaleWidth 1.75, msoTrue 
    Case Else 
        s.ScaleHeight 1.75, msoFalse 
        s.ScaleWidth 1.75, msoFalse 
    End Select 
Next

[!includeSupport and feedback]