A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Charts and Charting
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

change the title of a checkbox



 
 
Thread Tools Display Modes
  #1  
Old October 15th, 2003, 03:29 PM
daMike
external usenet poster
 
Posts: n/a
Default change the title of a checkbox

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
  #2  
Old October 15th, 2003, 05:06 PM
Andy Pope
external usenet poster
 
Posts: n/a
Default change the title of a checkbox

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


daMike wrote:

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

  #3  
Old October 16th, 2003, 06:39 AM
daMike
external usenet poster
 
Posts: n/a
Default change the title of a checkbox

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


Andy Pope wrote in message ...
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


daMike wrote:

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

  #4  
Old October 16th, 2003, 03:46 PM
Andy Pope
external usenet poster
 
Posts: n/a
Default change the title of a checkbox

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.

daMike wrote:

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


Andy Pope wrote in message ...

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


daMike wrote:


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

  #5  
Old October 16th, 2003, 06:08 PM
Jon Peltier
external usenet poster
 
Posts: n/a
Default change the title of a checkbox

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
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______


Andy Pope wrote:

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.

daMike wrote:

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


Andy Pope wrote in message
...

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


daMike wrote:


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




 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:16 PM.


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