Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copying Named Ranges in Chart Series | Charts and Charting in Excel | |||
URGENT: Using Named Ranges with Chart Wizard | Excel Worksheet Functions | |||
Like 123, allow named ranges, and print named ranges | Excel Discussion (Misc queries) | |||
named ranges - changing ranges with month selected | Excel Programming | |||
Named Ranges | Excel Programming |