Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default create graphic autmatically with VB


Hello

I need your help for create graphics.
I create graphics from a page with many source data

For example:

avril mai juin
ent 1 2 1 12
ent2 36 2 444
ent3 63 365 111
ent4 3 2 545
avril mai juin
ent1 1 2 23
ent2 2 36 22
ent3 5 252 22
ent4 2 2 214

My probleme is with the data capture.

This the code
Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlBuiltIn, TypeName:= _
"Courbe - Histo. 2 axes"
ActiveChart.SetSourceData Source:=Sheets("Feuil1").Range("B2:E6"), PlotBy:=
_
xlRows
ActiveChart.Location Whe=xlLocationAsObject, Name:="Feuil2"
I think taht the "RAnge("B2:E5")" must not be fixed but it could be like
"Range("case1:case2")",
With case1=A2 then case1=A2+5 i.e. case1=A7
Like wise for case2=E5 then case2=E5+5 i.e. casee2=E10

The number of source data is not fixed, the function had to stop when it is no
more value.
I try to do somethong like:
"Ifcase1<Activesheet.UsedRange.Rows.Count then go to begin" with begin tehe
beginning of the buckle,but i need the field "case1".

So if need be, i can give you an example.
Thanks for your help
Elve

PS: excuse me if my english is not perfect i am french...
--
Ce message a ete poste via la plateforme Web club-Internet.fr
This message has been posted by the Web platform club-Internet.fr

http://forums.club-internet.fr/
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default create graphic autmatically with VB

Elve -

One simplistic way is to use the Offset property of Range. At some
point you can define the value of the integer iChart, and let it equal 1
for the first chart, etc. then change Range("B2:E6") in your code to

Range("B2:E6").Offset((iChart - 1) * 5)

There are more detailed ways to do this that either edit the text of the
range reference or define range variables.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______

Elve wrote:
Hello

I need your help for create graphics.
I create graphics from a page with many source data

For example:

avril mai juin
ent 1 2 1 12
ent2 36 2 444
ent3 63 365 111
ent4 3 2 545
avril mai juin
ent1 1 2 23
ent2 2 36 22
ent3 5 252 22
ent4 2 2 214

My probleme is with the data capture.

This the code
Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlBuiltIn, TypeName:= _
"Courbe - Histo. 2 axes"
ActiveChart.SetSourceData Source:=Sheets("Feuil1").Range("B2:E6"), PlotBy:=
_
xlRows
ActiveChart.Location Whe=xlLocationAsObject, Name:="Feuil2"
I think taht the "RAnge("B2:E5")" must not be fixed but it could be like
"Range("case1:case2")",
With case1=A2 then case1=A2+5 i.e. case1=A7
Like wise for case2=E5 then case2=E5+5 i.e. casee2=E10

The number of source data is not fixed, the function had to stop when it is no
more value.
I try to do somethong like:
"Ifcase1<Activesheet.UsedRange.Rows.Count then go to begin" with begin tehe
beginning of the buckle,but i need the field "case1".

So if need be, i can give you an example.
Thanks for your help
Elve

PS: excuse me if my english is not perfect i am french...


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
Filtering of data - autmatically based on data on other sheet uptonfamilywa Excel Discussion (Misc queries) 1 June 20th 09 12:46 AM
Axes values changes autmatically / textboxes lose formatting Anand Nichkaode Charts and Charting in Excel 5 March 28th 08 04:30 PM
Create a Macro to give movement to a graphic. [email protected] Excel Discussion (Misc queries) 4 January 9th 08 12:04 AM
About lineal graphic Miguel Angel Charts and Charting in Excel 3 April 28th 06 10:30 AM
how do i create and save a new file or worksheet autmatically ever DAN Excel Discussion (Misc queries) 0 March 30th 05 03:07 PM


All times are GMT +1. The time now is 10:52 AM.

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"