Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Chart from VBA

Hello,
I have several people I chart their number of calls made on a daily basis.
Each person has his/her own worksheet.
I have named the totals I want to chart as named ranges (i.e. Week1,
Week2...)
I have also created a list using insert.name/paste/paste list to create a
drop down list of all the named ranges.

I have used the macro recorder to record making the chart but every time I
try to change the chart range to the named range I get an error.

I would like to be able to use the selection in the dropdown list to create
a chart from VBA.
Can anyone point me to a KB article or does someone already have something
like this they might share.
Thanks
James


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Chart from VBA

You can find some help he
http://peltiertech.com/Excel/Charts/ChartByControl.html

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Chart from VBA


Thanks Alen32, this was helpful,
I got everything working, but I can't seem to figure out how to get the
range part to work
..Range(james_week_1) instead of .Range("B104:F105")

If I put a defined name range where the B104:F105 is I get an error.

Does anyone know how to put (or can it be done) in a named range?
Thanks
James


'================================================= ===
Dim strChart As String
dim strSheetName as String

'get the employees name
lngPos_1 = (InStr(strChart, "_") - 1)
strSheetName = Left(strChart, lngPos_1)

'get the selection from the drop down listbox
strChart = cmbCharts.Text

'define the data to be charted
ActiveChart.ChartType = xlLineMarkers
ActiveChart.SetSourceData
Source:=Sheets(strSheetName).Range("B104:F105"), _
PlotBy:=xlRows
ActiveChart.Location Whe=xlLocationAsObject, Name:="Totals"


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
In Office 2007 can't see chart series values unless chart unprotec Carl Charts and Charting in Excel 0 October 28th 09 03:31 AM
Excel 2003 is missing Built-In Custom Chart Types in Chart Wizard Julius Charts and Charting in Excel 2 March 6th 09 04:43 PM
Excel 2003 is missing Built-In Custom Chart Types in Chart Wizard Julius Setting up and Configuration of Excel 1 March 6th 09 01:57 AM
Excel 2003: How to nudge a chart element or shape on a chart? Ted M H Charts and Charting in Excel 5 June 30th 08 07:08 PM
chart from pivot data does not update x-axis bar chart values - bug jason gers Excel Discussion (Misc queries) 0 April 3rd 07 06:34 PM


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