Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default Change 'Caption' on ToggleButtons with VBA

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".
--
Thanks for any advice,
Jay
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change caption of a button Dylan @ UAFC[_2_] Excel Worksheet Functions 3 November 25th 08 07:04 PM
Change 'Caption' on ToggleButtons with VBA Greg Wilson Excel Programming 0 March 28th 07 02:47 AM
Change 'Caption' on ToggleButtons with VBA JLGWhiz Excel Programming 2 March 28th 07 02:03 AM
Change 'Caption' on ToggleButtons with VBA Jay Excel Programming 1 March 28th 07 01:08 AM
change the value of togglebuttons Nelson Excel Programming 1 November 10th 04 04:17 AM


All times are GMT +1. The time now is 08:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"