PC Review


Reply
Thread Tools Rate Thread

Charting through VB.

 
 
Dunner
Guest
Posts: n/a
 
      2nd Jul 2003
Hi,

I have run into a little problem while trying to update
charts using VB and was wondering if anyone can help.

Basically I have an excel 2000 workbook which is split
into several different sheets. The primary sheet is were
I am storing figures and the like and all the others are
charts which are built from these figures. Using VB I
have created a user form that takes the required
information places it in the the spreadsheet in the right
places and then - hopefully - updates the charts.

Unfortunately I can't get the charts to update with the
right data. So far I have tried using:

ActiveChart.SetSourceData Source:=Sheets("1").Range
("<requiredrange>"), PlotBy _
:=xlColumns

which works for the first graph (a4:b103) but doesn't for
the next as it plots two seperate series, one for column
B and one for column C. What I want to do is plot the
data in row A against the data in rows B-AC on the
different sheets (one sheet for each graph), all from
pressing a button on my VB userform. Can this be done and
if so how?

Thanks for your help.

Dunner
 
Reply With Quote
 
 
 
 
Tushar Mehta
Guest
Posts: n/a
 
      2nd Jul 2003
What does "required range" contain?

The foll. works just fine:

--
Regards,

Tushar Mehta (www.tushar-mehta.com) MS MVP -- Excel

In article <085001c34088$34890230$(E-Mail Removed)>,
(E-Mail Removed) says...
> Hi,
>
> I have run into a little problem while trying to update
> charts using VB and was wondering if anyone can help.
>
> Basically I have an excel 2000 workbook which is split
> into several different sheets. The primary sheet is were
> I am storing figures and the like and all the others are
> charts which are built from these figures. Using VB I
> have created a user form that takes the required
> information places it in the the spreadsheet in the right
> places and then - hopefully - updates the charts.
>
> Unfortunately I can't get the charts to update with the
> right data. So far I have tried using:
>
> ActiveChart.SetSourceData Source:=Sheets("1").Range
> ("<requiredrange>"), PlotBy _
> :=xlColumns
>
> which works for the first graph (a4:b103) but doesn't for
> the next as it plots two seperate series, one for column
> B and one for column C. What I want to do is plot the
> data in row A against the data in rows B-AC on the
> different sheets (one sheet for each graph), all from
> pressing a button on my VB userform. Can this be done and
> if so how?
>
> Thanks for your help.
>
> Dunner
>

 
Reply With Quote
 
Tushar Mehta
Guest
Posts: n/a
 
      2nd Jul 2003
[This followup was posted to microsoft.public.excel.charting with an
email copy to Dunner.
Please use the newsgroup for further discussion.]

What does "required range" contain?

The foll. works just fine:

Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData _
Source:=Sheets("Sheet2").Range("A13:A15,C13:C15")
ActiveChart.Location Where:=xlLocationAsObject, Name:="Sheet2"

--
Regards,

Tushar Mehta (www.tushar-mehta.com) MS MVP -- Excel

In article <085001c34088$34890230$(E-Mail Removed)>,
(E-Mail Removed) says...
> Hi,
>
> I have run into a little problem while trying to update
> charts using VB and was wondering if anyone can help.
>
> Basically I have an excel 2000 workbook which is split
> into several different sheets. The primary sheet is were
> I am storing figures and the like and all the others are
> charts which are built from these figures. Using VB I
> have created a user form that takes the required
> information places it in the the spreadsheet in the right
> places and then - hopefully - updates the charts.
>
> Unfortunately I can't get the charts to update with the
> right data. So far I have tried using:
>
> ActiveChart.SetSourceData Source:=Sheets("1").Range
> ("<requiredrange>"), PlotBy _
> :=xlColumns
>
> which works for the first graph (a4:b103) but doesn't for
> the next as it plots two seperate series, one for column
> B and one for column C. What I want to do is plot the
> data in row A against the data in rows B-AC on the
> different sheets (one sheet for each graph), all from
> pressing a button on my VB userform. Can this be done and
> if so how?
>
> Thanks for your help.
>
> Dunner
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Charting =?Utf-8?B?cHVyYWthbnVp?= Microsoft Excel Worksheet Functions 1 3rd Nov 2005 09:15 AM
Custom charting - Stacked charting with a line Randy Lefferts Microsoft Excel Charting 3 3rd Mar 2005 03:10 AM
charting Lora Microsoft Excel Misc 2 3rd Sep 2004 01:48 AM
Charting help saziz Microsoft Excel Misc 2 22nd Jul 2004 04:47 PM
Re: Charting Debra Dalgleish Microsoft Excel Misc 0 8th Aug 2003 03:29 AM


Features
 

Advertising
 

Newsgroups
 


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