PC Review


Reply
Thread Tools Rate Thread

Change 'Caption' on ToggleButtons with VBA

 
 
=?Utf-8?B?SmF5?=
Guest
Posts: n/a
 
      28th Mar 2007
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change default caption color in References/Insert Caption? Nick Piazza Microsoft Word Document Management 4 13th Jul 2009 07:00 PM
RE: Change 'Caption' on ToggleButtons with VBA =?Utf-8?B?R3JlZyBXaWxzb24=?= Microsoft Excel Programming 0 28th Mar 2007 02:47 AM
RE: Change 'Caption' on ToggleButtons with VBA =?Utf-8?B?SkxHV2hpeg==?= Microsoft Excel Programming 2 28th Mar 2007 02:03 AM
RE: Change 'Caption' on ToggleButtons with VBA =?Utf-8?B?SmF5?= Microsoft Excel Programming 1 28th Mar 2007 01:08 AM
change the value of togglebuttons =?Utf-8?B?TmVsc29u?= Microsoft Excel Programming 1 10th Nov 2004 04:17 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:15 AM.