Width Property

Microsoft Excel Visual Basic

Show All

Width Property

       

Width property as it applies to the Application object.

The distance from the left edge of the application window to its right edge. If the window is minimized, Application.Width is read-only and returns the width of the window icon. Read/write Double.

expression.Width

expression   Required. An expression that returns an Application object.

Width property as it applies to the Window object.

The width of the window. Use the UsableWidth 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. Read/write Double.

expression.Width

expression   Required. An expression that returns a Window object.

Width property as it applies to the ChartArea, ChartObject, ChartObjects, Legend, OLEObject, OLEObjects, and PlotArea objects.

The width of the object. Read/write Double.

expression.Width

expression   Required. An expression that returns one of the above objects.

Width property as it applies to the Axis, LegendEntry, and LegendKey objects.

The width of the object. Read-only Double.

expression.Width

expression   Required. An expression that returns one of the above objects.

Width property as it applies to the Graphic, Shape, and ShapeRange objects.

The width of the object. Read/write Single.

expression.Width

expression   Required. An expression that returns one of the above objects.

Width property as it applies to the Range object.

The width of the range. Read-only Variant.

expression.Width

expression   Required. An expression that returns a Range object.

Example

As it applies to the Application object.

This example expands the active window to the maximum size available (assuming that the window isn’t maximized).

With ActiveWindow
    .WindowState = xlNormal
    .Top = 1
    .Left = 1
    .Height = Application.UsableHeight
    .Width = Application.UsableWidth
End With

As it applies to the ChartArea, ChartObject, ChartObjects, Legend, OLEObject, OLEObjects, and PlotArea objects.

This example sets the width of the embedded chart.

Worksheets("Sheet1").ChartObjects(1).Width = 360