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 Named Ranges for Chart


Hi All,

I'm trying to write a macro to produce a chart where the data change
dependant on what day is picked. So far it is only pulling up th
original day where the named range in the sheet points to. I have th
following code to run which should change the range:


Code
-------------------

ActiveAddress = ActiveCell.Offset(3, 0).Address
ActiveColumn = Left(ActiveAddress, 2)
ActiveSRange = ActiveAddress & ":" & ActiveColumn
With Worksheets("Category")
Set CVRange = .Range(ActiveSRange & .Cells(.Rows.Count, "A").End(xlUp).Row)
Set CTRange = .Range("B10:B" & .Cells(.Rows.Count, "A").End(xlUp).Row)
End With

Sheets("tmpChart").Activate
Set Cht = Charts.Add
Set Cht = Cht.Location(Whe=xlLocationAsObject, Name:="tmpChart")
With Cht
.ChartType = xlPie
.SetSourceData Source:=Sheets("Category").Range("CVRange"), _
PlotBy:=xlColumns
.SeriesCollection(1).XValues = CTRange
.HasTitle = True
.ChartTitle.Characters.Text = "Category Chart - " & ChartDay
With .Parent
.Top = Range("B7").Top
.Left = Range("B7").Left
.Name = "DayChart"
End With
End With

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

Can anyone help.
Thank yo

--
Sami8
-----------------------------------------------------------------------
Sami82's Profile: http://www.excelforum.com/member.php...fo&userid=2711
View this thread: http://www.excelforum.com/showthread.php?threadid=54838

 
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
Copying Named Ranges in Chart Series Revolvr Charts and Charting in Excel 1 March 18th 10 12:21 PM
URGENT: Using Named Ranges with Chart Wizard artisdepartis Excel Worksheet Functions 4 July 3rd 07 07:46 AM
Like 123, allow named ranges, and print named ranges WP Excel Discussion (Misc queries) 1 April 8th 05 06:07 PM
named ranges - changing ranges with month selected gr8guy Excel Programming 2 May 28th 04 04:50 AM
Named Ranges Sunny_Delight Excel Programming 2 February 8th 04 08:48 PM


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