Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Creating Charts in VBA Code


I am new to VBA and I have a question related to creating charts. I'd
appreciate any tips on how to accomplish this ... thanks in advance.

I have been trying to accomplish displaying charts by clicking on
Option buttons. And I am still not quite there (some of my solutions
have been very slow, etc.).

I have 5 different charts that I have located the data ranges (but for
3 of the charts the data range is a SERIES) that are needed.

For example I have

2 Pie Charts and the data ranges are in a series
1 Combination Chart
2 Stacked Colum Charts

These all exist now on a worksheet that I will need to get rid of. I
want to click on an option button, and display each chart, and protect
the chart. I will want to display one chart at a time. But since I
will need to specify my data ranges in the code, I am not quite clear
on how this piece of code should flow. Can anyone point me in the
right direction?

Thanks,
Julia

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 339
Default Creating Charts in VBA Code


wrote in message
oups.com...

I am new to VBA and I have a question related to creating charts. I'd
appreciate any tips on how to accomplish this ... thanks in advance.

I have been trying to accomplish displaying charts by clicking on
Option buttons. And I am still not quite there (some of my solutions
have been very slow, etc.).

I have 5 different charts that I have located the data ranges (but for
3 of the charts the data range is a SERIES) that are needed.

For example I have

2 Pie Charts and the data ranges are in a series
1 Combination Chart
2 Stacked Colum Charts

These all exist now on a worksheet that I will need to get rid of. I
want to click on an option button, and display each chart, and protect
the chart. I will want to display one chart at a time. But since I
will need to specify my data ranges in the code, I am not quite clear
on how this piece of code should flow. Can anyone point me in the
right direction?

Thanks,
Julia


Since you already seem to know how to create charts manually, your best
option is to turn on the macro recorder and then recrate the charts. Use
Tools|Macro|Record new macro. A new window will appear with a stop button
that you must press on when you're done. Using tools|Macro|Macros... you can
view the generated code. I use the Swedish version of Excel so the
translation may not be perfect. Does this answer your question?

/Fredrik


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Creating Charts in VBA Code

Not really but thanks for the reply. One of my issues is that I am not
quite sure of the most efficient way to do this. I was hoping someone
might read my post and confirm that my ideas are in the right
direction, or share with me a better way to handle this. I am not
quite sure how to deal with the data in a series. It might help to see
a code sample of how to do this. I will give the macro recorder a try.
Thx.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Creating Charts in VBA Code

Some sample code:

http://support.microsoft.com/default...40&Product=xlw
XL97: How To Create a Dynamic Chart Using Visual Basic

http://support.microsoft.com/default...80&Product=xlw
XL2000: How to Use Visual Basic to Create a Dynamic Chart

http://support.microsoft.com/default...55&Product=xlw
Using Visual Basic to Create a Chart Using a Dynamic Range


Also look at Jon Peltier's site:
http://PeltierTech.com/

--
Regards,
Tom Ogilvy



wrote in message
oups.com...
Not really but thanks for the reply. One of my issues is that I am not
quite sure of the most efficient way to do this. I was hoping someone
might read my post and confirm that my ideas are in the right
direction, or share with me a better way to handle this. I am not
quite sure how to deal with the data in a series. It might help to see
a code sample of how to do this. I will give the macro recorder a try.
Thx.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Creating Charts in VBA Code

Thanks directing me to some useful information.

Julia

Tom Ogilvy wrote:
Some sample code:


http://support.microsoft.com/default...40&Product=xlw
XL97: How To Create a Dynamic Chart Using Visual Basic


http://support.microsoft.com/default...80&Product=xlw
XL2000: How to Use Visual Basic to Create a Dynamic Chart


http://support.microsoft.com/default...55&Product=xlw
Using Visual Basic to Create a Chart Using a Dynamic Range


Also look at Jon Peltier's site:
http://PeltierTech.com/

--
Regards,
Tom Ogilvy



wrote in message
oups.com...
Not really but thanks for the reply. One of my issues is that I am

not
quite sure of the most efficient way to do this. I was hoping

someone
might read my post and confirm that my ideas are in the right
direction, or share with me a better way to handle this. I am not
quite sure how to deal with the data in a series. It might help to

see
a code sample of how to do this. I will give the macro recorder a

try.
Thx.


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
Creating charts with VBA code Ayo Charts and Charting in Excel 2 April 8th 09 12:08 PM
Creating charts Novice Excel Discussion (Misc queries) 2 September 29th 08 03:17 PM
Creating Charts coke Charts and Charting in Excel 1 March 31st 06 06:54 PM
Creating organizational charts using VBA code? KitKat Excel Programming 3 April 3rd 04 12:01 AM


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