Height Property

Applies To

Application Object, Arc Object, Arcs Collection, Button Object, Buttons Collection, ChartArea Object, ChartObject Object, ChartObjects Collection, CheckBox Object, DialogFrame Object, Drawing Object, DrawingObjects Collection, Drawings Collection, DropDown Object, DropDowns Collection, EditBox Object, EditBoxes Collection, GroupBox Object, GroupBoxes Collection, GroupObject Object, GroupObjects Collection, Label Object, Labels Collection, Legend Object, Line Object, Lines Collection, ListBox Object, ListBoxes Collection, OLEObject Object, OLEObjects Collection, OptionButton Object, OptionButtons Collection, Oval Object, Ovals Collection, Picture Object, Pictures Collection, PlotArea Object, Range Object, Rectangle Object, Rectangles Collection, ScrollBar Object, ScrollBars Collection, Spinner Object, Spinners Collection, TextBox Object, TextBoxes Collection, Toolbar Object, Window Object.

Description

Returns or sets the height of an object, in points (1/72 inch).

Remarks

The height set or returned depends on the specified object.

Object type

Height

Application

Height of the main Application window. On the Apple Macintosh this is always equal to the total height of the screen, in points. Setting this value to something else on the Macintosh will have no effect. In Windows, if the window is minimized, this property is read-only and refers to the height of the icon. If the window is maximized, this property cannot be set. Use the WindowState property to determine the window state.

Range

Height of the range. Read-only.

Toolbar

Height of the toolbar. Returns the exact height of the toolbar in points. Use the Width property to change the size of the toolbar. Read-only.

Window

Height of the window. Use the UsableHeight property to determine the maximum size for the window.

You cannot set this property if the window is maximized or minimized. Use the WindowState property to determine the window state.

Arc, Button, ChartArea, ChartObject, CheckBox, DialogFrame, Drawing, DrawingObjects, DropDown, EditBox, GroupBox, GroupObject, Label, Legend, Line, ListBox, OLEObject, OptionButton, Oval, Picture, PlotArea, Rectangle, ScrollBar, Spinner, TextBox

Height of the object. If you set the height for an entire collection of objects (using Ovals.Height = 100, for example), the height of each object changes in proportion to its existing height (this mimics the behavior of selecting all the objects and then dragging a handle to change the height of the selection). This means that the height of each object changes, but they are not all set to the same height. To set every object in the collection to the same height, you must iterate the collection and set the height of each individual object.


You can use negative numbers to set the Height and Width properties of the following drawing objects: Arc, Button, CheckBox, Drawing, DropDown, EditBox, GroupBox, GroupObject, Label, Line, ListBox, OLEObject, OptionButton, Oval, Picture, Rectangle, ScrollBar, Spinner, and TextBox. This causes the object to reflect or translate (the behavior depends on the object), after which the Top and Left properties change to describe the new position. The Height and Width properties always return positive numbers.

See Also

Left Property, Top Property, Width Property.

Example

This example sets the height of oval one on Sheet1 to 1 inch (72 points).


Worksheets("Sheet1").Ovals(1).Height = 72

This example sets the height of every button on Sheet1 to 18 points.


For Each b In Worksheets("Sheet1").Buttons
    b.Height = 18
Next b