PC Review


Reply
Thread Tools Rate Thread

Changing Series for a chart

 
 
drew1987
Guest
Posts: n/a
 
      2nd Jun 2008
I am making my own budget spreadsheet and have a ComboBox with all 12 months
and a chart showing the Income, Expense, and Balance of a given month.

My problem is I can't code VB to automatically change the series values for
the chart. Any suggestions?
 
Reply With Quote
 
 
 
 
Jon Peltier
Guest
Posts: n/a
 
      2nd Jun 2008
How is the data arranges? What kind of chart is it and how do you want it to
reflect what the combo shows? This tutorial might have something you can
use:

http://peltiertech.com/Excel/Charts/ChartByControl.html

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"drew1987" <(E-Mail Removed)> wrote in message
news:774C07A8-BC73-4393-9539-(E-Mail Removed)...
>I am making my own budget spreadsheet and have a ComboBox with all 12
>months
> and a chart showing the Income, Expense, and Balance of a given month.
>
> My problem is I can't code VB to automatically change the series values
> for
> the chart. Any suggestions?



 
Reply With Quote
 
drew1987
Guest
Posts: n/a
 
      3rd Jun 2008
I have 2 worksheets, "Budget" and "Chart".
Budget (Categories in no particular order):

row/column D E O
Jan Feb ......... Dec
6 Income 200 200 200
.....
12 Balance 100 100 100
13 Expenses 100 100 100

Chart:
I have a Column Chart of all 12 months, but I need (per selection of ComboBox)
1. Monthly Regular Bar chart of inc, exp, and balance
2. Pie Chart of subsections of Expenses (I can probably get this after
figuring out #1)



"Jon Peltier" wrote:

> How is the data arranges? What kind of chart is it and how do you want it to
> reflect what the combo shows? This tutorial might have something you can
> use:
>
> http://peltiertech.com/Excel/Charts/ChartByControl.html
>
> - Jon
> -------
> Jon Peltier, Microsoft Excel MVP
> Tutorials and Custom Solutions
> Peltier Technical Services, Inc. - http://PeltierTech.com
> _______
>
>
> "drew1987" <(E-Mail Removed)> wrote in message
> news:774C07A8-BC73-4393-9539-(E-Mail Removed)...
> >I am making my own budget spreadsheet and have a ComboBox with all 12
> >months
> > and a chart showing the Income, Expense, and Balance of a given month.
> >
> > My problem is I can't code VB to automatically change the series values
> > for
> > the chart. Any suggestions?

>
>
>

 
Reply With Quote
 
drew1987
Guest
Posts: n/a
 
      3rd Jun 2008
That didn't come out right, but its setup like your example. I couldn't view
your code, so here is mine to get the value for the OFFSET.

Private Sub MonthList_Change()
If MonthList.Value = "" Then Exit Sub
ElseIf MonthList.Value = "January" Then Range("B35").Value = 1
ElseIf MonthList.Value = "February" Then Range("B35").Value = 2
ElseIf MonthList.Value = "March" Then Range("B35").Value = 3
ElseIf MonthList.Value = "April" Then Range("B35").Value = 4
ElseIf MonthList.Value = "May" Then Range("B35").Value = 5
ElseIf MonthList.Value = "June" Then Range("B35").Value = 6
ElseIf MonthList.Value = "July" Then Range("B35").Value = 7
ElseIf MonthList.Value = "August" Then Range("B35").Value = 8
ElseIf MonthList.Value = "September" Then Range("B35").Value = 9
ElseIf MonthList.Value = "October" Then Range("B35").Value = 10
ElseIf MonthList.Value = "November" Then Range("B35").Value = 11
ElseIf MonthList.Value = "December" Then Range("B35").Value = 12
End If
End Sub


Then to get each months inc/exp/bal I put O36, O37, O38 respectively. I
cant get this part to work yet because of the problem above.

=offset(B36, 0, $B$35)
=offset(B37, 0, $B$35)
-offset(B38, 0, $B$35)



 
Reply With Quote
 
Ed Ferrero
Guest
Posts: n/a
 
      3rd Jun 2008
Sounds like you are trying to do too much in VBA. Look at the 'Reporting'
example at http://www.edferrero.com/ExcelCharts...2/Default.aspx

This does not use VBA, just demonstrates good layout and the use of OFFSET
functions.
--
Ed Ferrero
www.edferrero.com


"drew1987" wrote:

> That didn't come out right, but its setup like your example. I couldn't view
> your code, so here is mine to get the value for the OFFSET.
>
> Private Sub MonthList_Change()
> If MonthList.Value = "" Then Exit Sub
> ElseIf MonthList.Value = "January" Then Range("B35").Value = 1
> ElseIf MonthList.Value = "February" Then Range("B35").Value = 2
> ElseIf MonthList.Value = "March" Then Range("B35").Value = 3
> ElseIf MonthList.Value = "April" Then Range("B35").Value = 4
> ElseIf MonthList.Value = "May" Then Range("B35").Value = 5
> ElseIf MonthList.Value = "June" Then Range("B35").Value = 6
> ElseIf MonthList.Value = "July" Then Range("B35").Value = 7
> ElseIf MonthList.Value = "August" Then Range("B35").Value = 8
> ElseIf MonthList.Value = "September" Then Range("B35").Value = 9
> ElseIf MonthList.Value = "October" Then Range("B35").Value = 10
> ElseIf MonthList.Value = "November" Then Range("B35").Value = 11
> ElseIf MonthList.Value = "December" Then Range("B35").Value = 12
> End If
> End Sub
>
>
> Then to get each months inc/exp/bal I put O36, O37, O38 respectively. I
> cant get this part to work yet because of the problem above.
>
> =offset(B36, 0, $B$35)
> =offset(B37, 0, $B$35)
> -offset(B38, 0, $B$35)
>
>
>

 
Reply With Quote
 
Jon Peltier
Guest
Posts: n/a
 
      3rd Jun 2008
Use a forms toolbar listbox, populate it with the list of months, and use
B35 as the link cell. B35 will then contain values between 1 and 12, based
on what has been selected.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"drew1987" <(E-Mail Removed)> wrote in message
news:7BFEFE4E-0DDF-4FE0-81DC-(E-Mail Removed)...
> That didn't come out right, but its setup like your example. I couldn't
> view
> your code, so here is mine to get the value for the OFFSET.
>
> Private Sub MonthList_Change()
> If MonthList.Value = "" Then Exit Sub
> ElseIf MonthList.Value = "January" Then Range("B35").Value = 1
> ElseIf MonthList.Value = "February" Then Range("B35").Value = 2
> ElseIf MonthList.Value = "March" Then Range("B35").Value = 3
> ElseIf MonthList.Value = "April" Then Range("B35").Value = 4
> ElseIf MonthList.Value = "May" Then Range("B35").Value = 5
> ElseIf MonthList.Value = "June" Then Range("B35").Value = 6
> ElseIf MonthList.Value = "July" Then Range("B35").Value = 7
> ElseIf MonthList.Value = "August" Then Range("B35").Value = 8
> ElseIf MonthList.Value = "September" Then Range("B35").Value = 9
> ElseIf MonthList.Value = "October" Then Range("B35").Value = 10
> ElseIf MonthList.Value = "November" Then Range("B35").Value = 11
> ElseIf MonthList.Value = "December" Then Range("B35").Value = 12
> End If
> End Sub
>
>
> Then to get each months inc/exp/bal I put O36, O37, O38 respectively. I
> cant get this part to work yet because of the problem above.
>
> =offset(B36, 0, $B$35)
> =offset(B37, 0, $B$35)
> -offset(B38, 0, $B$35)
>
>
>



 
Reply With Quote
 
drew1987
Guest
Posts: n/a
 
      3rd Jun 2008
This is exactly what I was looking for! I need to do more with this now!

Thanks alot Jon!



"Jon Peltier" wrote:

> Use a forms toolbar listbox, populate it with the list of months, and use
> B35 as the link cell. B35 will then contain values between 1 and 12, based
> on what has been selected.
>
> - Jon
> -------
> Jon Peltier, Microsoft Excel MVP
> Tutorials and Custom Solutions
> Peltier Technical Services, Inc. - http://PeltierTech.com
> _______
>
>
> "drew1987" <(E-Mail Removed)> wrote in message
> news:7BFEFE4E-0DDF-4FE0-81DC-(E-Mail Removed)...
> > That didn't come out right, but its setup like your example. I couldn't
> > view
> > your code, so here is mine to get the value for the OFFSET.
> >
> > Private Sub MonthList_Change()
> > If MonthList.Value = "" Then Exit Sub
> > ElseIf MonthList.Value = "January" Then Range("B35").Value = 1
> > ElseIf MonthList.Value = "February" Then Range("B35").Value = 2
> > ElseIf MonthList.Value = "March" Then Range("B35").Value = 3
> > ElseIf MonthList.Value = "April" Then Range("B35").Value = 4
> > ElseIf MonthList.Value = "May" Then Range("B35").Value = 5
> > ElseIf MonthList.Value = "June" Then Range("B35").Value = 6
> > ElseIf MonthList.Value = "July" Then Range("B35").Value = 7
> > ElseIf MonthList.Value = "August" Then Range("B35").Value = 8
> > ElseIf MonthList.Value = "September" Then Range("B35").Value = 9
> > ElseIf MonthList.Value = "October" Then Range("B35").Value = 10
> > ElseIf MonthList.Value = "November" Then Range("B35").Value = 11
> > ElseIf MonthList.Value = "December" Then Range("B35").Value = 12
> > End If
> > End Sub
> >
> >
> > Then to get each months inc/exp/bal I put O36, O37, O38 respectively. I
> > cant get this part to work yet because of the problem above.
> >
> > =offset(B36, 0, $B$35)
> > =offset(B37, 0, $B$35)
> > -offset(B38, 0, $B$35)
> >
> >
> >

>
>
>

 
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
Changing Values in Chart Series Karen Microsoft Excel Charting 2 10th Jul 2009 09:32 AM
Changing chart types with series =?Utf-8?B?bWl0ZWVrYQ==?= Microsoft Excel Charting 3 15th Feb 2007 09:07 PM
Chart select, yet changing set of series name Microsoft Excel Charting 5 8th Jul 2006 02:33 PM
Changing Chart Data Series =?Utf-8?B?c2h1bg==?= Microsoft Access VBA Modules 1 10th Jan 2006 11:06 PM
Changing Chart data series Anne Microsoft Excel Charting 1 4th Nov 2003 03:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:18 AM.