View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Greg Wilson Greg Wilson is offline
external usenet poster
 
Posts: 747
Default Change 'Caption' on ToggleButtons with VBA

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