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

Thanks a bunch, Greg. The Object property of the OleObjects collection was
what I was missing. Your procedure worked perfectly and I'll be using this a
lot in the near future.

--
Thanks again,
Jay


"Greg Wilson" wrote:

Try:

Sub addToggles()
Dim i As Integer
For i = 0 To 1
With ActiveSheet.OLEObjects.Add("Forms.ToggleButton.1", _
Left:=1 + i * 73, Top:=243, Width:=72, Height:=30.75)
.Object.Caption = IIf(i = 0, "Start Date", "End Date")
End With
Next
End Sub

Regards,
Greg



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 747
Default Change 'Caption' on ToggleButtons with VBA

You're welcome. Thanks for the feedback.

Greg

"Jay" wrote:

Thanks a bunch, Greg. The Object property of the OleObjects collection was
what I was missing. Your procedure worked perfectly and I'll be using this a
lot in the near future.

--
Thanks again,
Jay


"Greg Wilson" wrote:

Try:

Sub addToggles()
Dim i As Integer
For i = 0 To 1
With ActiveSheet.OLEObjects.Add("Forms.ToggleButton.1", _
Left:=1 + i * 73, Top:=243, Width:=72, Height:=30.75)
.Object.Caption = IIf(i = 0, "Start Date", "End Date")
End With
Next
End Sub

Regards,
Greg



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 JLGWhiz Excel Programming 2 March 28th 07 02:03 AM
Change Caption of Button Alexander Excel Programming 3 August 17th 05 04:45 PM
change the value of togglebuttons Nelson Excel Programming 1 November 10th 04 04:17 AM
Change CommandButton Caption Claude Excel Programming 4 July 16th 04 04:18 PM


All times are GMT +1. The time now is 07:34 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"