J
Jay
Hi all -
The following procedure works propertly, adding two toggle buttons to the
active sheet:
Sub addToggles()
Dim oleObj As OLEObject
Set oleObj = ActiveSheet.OLEObjects.Add _
(ClassType:="Forms.ToggleButton.1", Link:=False, _
DisplayAsIcon:=False, Left:=0.75, Top:=243, Width:=72, _
Height:=30.75)
Set oleObj = ActiveSheet.OLEObjects.Add _
(ClassType:="Forms.ToggleButton.1", Link:=False, _
DisplayAsIcon:=False, Left:=74.25, Top:=243, Width:=72, _
Height:=30.75)
End Sub
What is the syntax for changing the button 'captions' from "ToggleButton1"
to "Start Date" and "ToggleButton2" to "End Date" ?
Thie following 'caption' statement doesn't work seemingly because these
buttons are on the worksheet (not on a user form):
Activesheet.ToggleButton1.Caption = "Start Date".
The following procedure works propertly, adding two toggle buttons to the
active sheet:
Sub addToggles()
Dim oleObj As OLEObject
Set oleObj = ActiveSheet.OLEObjects.Add _
(ClassType:="Forms.ToggleButton.1", Link:=False, _
DisplayAsIcon:=False, Left:=0.75, Top:=243, Width:=72, _
Height:=30.75)
Set oleObj = ActiveSheet.OLEObjects.Add _
(ClassType:="Forms.ToggleButton.1", Link:=False, _
DisplayAsIcon:=False, Left:=74.25, Top:=243, Width:=72, _
Height:=30.75)
End Sub
What is the syntax for changing the button 'captions' from "ToggleButton1"
to "Start Date" and "ToggleButton2" to "End Date" ?
Thie following 'caption' statement doesn't work seemingly because these
buttons are on the worksheet (not on a user form):
Activesheet.ToggleButton1.Caption = "Start Date".