Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
Bob Bob is offline
external usenet poster
 
Posts: 972
Default Link embedded chart to a commandbutton?

I have a embedded chart which I wish to show the chart when I press a
commandButton and hide the chart when I press either the same button or
another one.
--
Bob
  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,489
Default Link embedded chart to a commandbutton?

Hi,

The basic code would be, which will toggle visibility of first chartobject
on sheet.

Sub Button2_Click()

ActiveSheet.ChartObjects(1).Visible = Not
ActiveSheet.ChartObjects(1).Visible

End Sub

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Bob" wrote in message
...
I have a embedded chart which I wish to show the chart when I press a
commandButton and hide the chart when I press either the same button or
another one.
--
Bob


  #3   Report Post  
Posted to microsoft.public.excel.charting
Bob Bob is offline
external usenet poster
 
Posts: 972
Default Link embedded chart to a commandbutton?

Many thanks Andy, I shall try that out on friday when i am back at work
--
Bob


"Andy Pope" wrote:

Hi,

The basic code would be, which will toggle visibility of first chartobject
on sheet.

Sub Button2_Click()

ActiveSheet.ChartObjects(1).Visible = Not
ActiveSheet.ChartObjects(1).Visible

End Sub

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Bob" wrote in message
...
I have a embedded chart which I wish to show the chart when I press a
commandButton and hide the chart when I press either the same button or
another one.
--
Bob



  #4   Report Post  
Posted to microsoft.public.excel.charting
Bob Bob is offline
external usenet poster
 
Posts: 972
Default Link embedded chart to a commandbutton?

Andy,
Tried it and I get a syntax error message
--
Bob


"Bob" wrote:

Many thanks Andy, I shall try that out on friday when i am back at work
--
Bob


"Andy Pope" wrote:

Hi,

The basic code would be, which will toggle visibility of first chartobject
on sheet.

Sub Button2_Click()

ActiveSheet.ChartObjects(1).Visible = Not
ActiveSheet.ChartObjects(1).Visible

End Sub

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Bob" wrote in message
...
I have a embedded chart which I wish to show the chart when I press a
commandButton and hide the chart when I press either the same button or
another one.
--
Bob



  #5   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,489
Default Link embedded chart to a commandbutton?

Probably because of the email formatting.

The syntax should be on 1 line.

Sub Button2_Click()

ActiveSheet.ChartObjects(1).Visible = _
Not ActiveSheet.ChartObjects(1).Visible
End Sub

Cheers
Andy
--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Bob" wrote in message
...
Andy,
Tried it and I get a syntax error message
--
Bob


"Bob" wrote:

Many thanks Andy, I shall try that out on friday when i am back at work
--
Bob


"Andy Pope" wrote:

Hi,

The basic code would be, which will toggle visibility of first
chartobject
on sheet.

Sub Button2_Click()

ActiveSheet.ChartObjects(1).Visible = Not
ActiveSheet.ChartObjects(1).Visible

End Sub

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Bob" wrote in message
...
I have a embedded chart which I wish to show the chart when I press a
commandButton and hide the chart when I press either the same button
or
another one.
--
Bob





  #6   Report Post  
Posted to microsoft.public.excel.charting
Bob Bob is offline
external usenet poster
 
Posts: 972
Default Link embedded chart to a commandbutton?

Andy thanks for that.
At the moment when I press the commanbutton(3) I can see the chart
underneath the active page?
--
Bob


"Andy Pope" wrote:

Probably because of the email formatting.

The syntax should be on 1 line.

Sub Button2_Click()

ActiveSheet.ChartObjects(1).Visible = _
Not ActiveSheet.ChartObjects(1).Visible
End Sub

Cheers
Andy
--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Bob" wrote in message
...
Andy,
Tried it and I get a syntax error message
--
Bob


"Bob" wrote:

Many thanks Andy, I shall try that out on friday when i am back at work
--
Bob


"Andy Pope" wrote:

Hi,

The basic code would be, which will toggle visibility of first
chartobject
on sheet.

Sub Button2_Click()

ActiveSheet.ChartObjects(1).Visible = Not
ActiveSheet.ChartObjects(1).Visible

End Sub

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Bob" wrote in message
...
I have a embedded chart which I wish to show the chart when I press a
commandButton and hide the chart when I press either the same button
or
another one.
--
Bob




  #7   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,489
Default Link embedded chart to a commandbutton?

Sorry I don't understand what you mean?

On a worksheet enter 1,2,3 in cells A1:A3
Select A1:A3 and insert a chart on to the worksheet.
Using the Forms toolbar add a button to the worksheet.
Right click the button and assign macro.

The code should be in a standard code module.

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Bob" wrote in message
...
Andy thanks for that.
At the moment when I press the commanbutton(3) I can see the chart
underneath the active page?
--
Bob


"Andy Pope" wrote:

Probably because of the email formatting.

The syntax should be on 1 line.

Sub Button2_Click()

ActiveSheet.ChartObjects(1).Visible = _
Not ActiveSheet.ChartObjects(1).Visible
End Sub

Cheers
Andy
--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Bob" wrote in message
...
Andy,
Tried it and I get a syntax error message
--
Bob


"Bob" wrote:

Many thanks Andy, I shall try that out on friday when i am back at
work
--
Bob


"Andy Pope" wrote:

Hi,

The basic code would be, which will toggle visibility of first
chartobject
on sheet.

Sub Button2_Click()

ActiveSheet.ChartObjects(1).Visible = Not
ActiveSheet.ChartObjects(1).Visible

End Sub

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Bob" wrote in message
...
I have a embedded chart which I wish to show the chart when I press
a
commandButton and hide the chart when I press either the same
button
or
another one.
--
Bob





  #8   Report Post  
Posted to microsoft.public.excel.charting
Bob Bob is offline
external usenet poster
 
Posts: 972
Default Link embedded chart to a commandbutton?

Andy,
I works well now Thanks very much
--
Bob


"Andy Pope" wrote:

Sorry I don't understand what you mean?

On a worksheet enter 1,2,3 in cells A1:A3
Select A1:A3 and insert a chart on to the worksheet.
Using the Forms toolbar add a button to the worksheet.
Right click the button and assign macro.

The code should be in a standard code module.

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Bob" wrote in message
...
Andy thanks for that.
At the moment when I press the commanbutton(3) I can see the chart
underneath the active page?
--
Bob


"Andy Pope" wrote:

Probably because of the email formatting.

The syntax should be on 1 line.

Sub Button2_Click()

ActiveSheet.ChartObjects(1).Visible = _
Not ActiveSheet.ChartObjects(1).Visible
End Sub

Cheers
Andy
--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Bob" wrote in message
...
Andy,
Tried it and I get a syntax error message
--
Bob


"Bob" wrote:

Many thanks Andy, I shall try that out on friday when i am back at
work
--
Bob


"Andy Pope" wrote:

Hi,

The basic code would be, which will toggle visibility of first
chartobject
on sheet.

Sub Button2_Click()

ActiveSheet.ChartObjects(1).Visible = Not
ActiveSheet.ChartObjects(1).Visible

End Sub

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Bob" wrote in message
...
I have a embedded chart which I wish to show the chart when I press
a
commandButton and hide the chart when I press either the same
button
or
another one.
--
Bob






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
How do I get rid of an embedded link in an Excel worksheet Ian Excel Discussion (Misc queries) 1 April 8th 09 11:46 PM
How do I link to an embedded object iamclayed Excel Discussion (Misc queries) 1 January 2nd 08 07:52 AM
Link to embedded spreadsheet TedMi Links and Linking in Excel 1 November 2nd 06 07:01 AM
Link To Embedded Object Brainfire Excel Discussion (Misc queries) 0 June 21st 06 02:40 PM
Pulling Embedded LInk Out of Cell bobbabuoy Excel Discussion (Misc queries) 2 April 14th 06 12:49 PM


All times are GMT +1. The time now is 01:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"