LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Naming a range and then use it to create chart

I have been struggling with this for hours and I seriously think this
is just a syntax error so if somebody can help me, I will really
appreciate it.

I check on previous topics in the discussion and I think this is the
right way to declare a name for range,

Let say in this case FNMACounter is 57 thus I want the range of A1:B57
as FNMARange
--------------------------------------------------------------------------------------------------------------------------------


Range(Cells(1, 1), Cells(FNMACounter, 2)).Name = "FNMARange"

----------------------------------------------------------------------------------------------------------------------------------

And then I used macro to create the chart,


Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.SetSourceData Source:=Sheets("FNMA
temp").Range("FNMARange"), _
PlotBy:=xlColumns
ActiveChart.Location Whe=xlLocationAsObject, Name:="Main Data"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "FNMA Chart"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text =
"Maturity Dates"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Yield"
End With
ActiveChart.HasLegend = False

somehow it keeps getting me application or object defined error, does
anybody know whats wrong with my code. Thank you!

 
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
How to create a chart with wide range of numbers Roxana Charts and Charting in Excel 3 October 16th 08 04:57 PM
Variable Range to Create Chart From Tommy N[_2_] Excel Programming 0 November 14th 06 09:48 PM
create chart from non adjacent range rita Charts and Charting in Excel 1 September 15th 06 04:16 AM
How to create a chart based on a 2 dim data range dynamical in 1 d Beertje Charts and Charting in Excel 1 October 25th 05 11:54 AM
create a chart without set range Noemi Excel Programming 4 September 26th 05 02:53 AM


All times are GMT +1. The time now is 10:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"