change the title of a checkbox

  • Thread starter Thread starter daMike
  • Start date Start date
D

daMike

Hello,

I have to know how I can change the title of a checkbox
with VBA code. The checkbox is placed on a chart so I see
no way - at the moment - how i can access the title ..
or other checkbox properties? Does anybody know how it
works?

Thanks in advance!
Michael
 
Hi Michael,

For a chart create on a worksheet with a checkbox contained within the
chart try something like this.

Sub Test()
With ActiveSheet.ChartObjects(1)
' display caption
MsgBox .Chart.Shapes("Check box 1").TextFrame.Characters.Text
' display tick status 1=ticked -4146=unticked
MsgBox .Chart.Shapes("Check box 1").ControlFormat.Value
End With
End Sub

Hello,

I have to know how I can change the title of a checkbox
with VBA code. The checkbox is placed on a chart so I see
no way - at the moment - how i can access the title ..
or other checkbox properties? Does anybody know how it
works?

Thanks in advance!
Michael

--

Cheers
Andy

http://www.andypope.info
 
Hi Andy,

the chart isn't on a worksheet. How can I find out what number
the ChartObject has (checkbox)? Does it work for not-embedded
charts too?

Thanks in advance!
daMike
 
Hi,

Yes it will also work for chartsheets.
Just modify the code slightly.

Sub Test()
With Charts("Chart1")
' display caption
MsgBox .Shapes("Check box 1").TextFrame.Characters.Text
' display tick status 1=ticked -4146=unticked
MsgBox .Shapes("Check box 1").ControlFormat.Value
End With
End Sub

The name of the checkboxes appears in the Name Box when the control is
selected.
Hi Andy,

the chart isn't on a worksheet. How can I find out what number
the ChartObject has (checkbox)? Does it work for not-embedded
charts too?

Thanks in advance!
daMike

--

Cheers
Andy

http://www.andypope.info
 
To use this for any chart, select the chart and run:

Sub Test()
With ActiveChart
' display caption
MsgBox .Shapes("Check box 1").TextFrame.Characters.Text
' display tick status 1=ticked -4146=unticked
MsgBox .Shapes("Check box 1").ControlFormat.Value
End With
End Sub

- Jon
 
Back
Top