Buttons Method

Applies To

Chart Object, DialogSheet Object, Worksheet Object.

Description

Accessor. Returns an object that represents a single button (a Button object, Syntax 1) or a collection of buttons (a Buttons object, Syntax 2) on the sheet. Read-only.

Syntax 1

object.Buttons(index)

Syntax 2

object.Buttons

object

Required. The object to which this method applies.

index

Required for Syntax 1. The name or number of the button.

Example

This example deletes every button on Sheet1.


Worksheets("Sheet1").Buttons.Delete

This example changes the text on button one on Sheet1.


Worksheets("Sheet1").Buttons(1).Text = "New Button Name"