Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The following code works to chart whatever is in
the active cell. What I need is to chart the active selection. Is there an easy to adjust this to do so? -Randy- PS: With the CheckBox1 option gone. Sub UpdateChart() Dim TheChartObj As ChartObject Dim TheChart As Chart Dim UserRow As Long Dim CatTitles As Range Dim SrcRange As Range Dim SourceData As Range If Sheets("Sheet1").CheckBox1 Then Set TheChartObj = ActiveSheet.ChartObjects(1) Set TheChart = TheChartObj.Chart UserRow = ActiveCell.Row If UserRow < 3 Or IsEmpty(Cells(UserRow, 1)) Then TheChartObj.Visible = False Else Set CatTitles = Range("A2:F2") Set SrcRange = Range(Cells(UserRow, 1), Cells(UserRow, 6)) Set SourceData = Union(CatTitles, SrcRange) TheChart.SetSourceData _ Source:=SourceData, PlotBy:=xlRows TheChartObj.Visible = True End If End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Update Current Row | Excel Discussion (Misc queries) | |||
update Totals using current date | Excel Discussion (Misc queries) | |||
Update current time automatically? | Excel Discussion (Misc queries) | |||
excel change default column sort to current selection | Excel Worksheet Functions | |||
Calculated value based on current line selection | Excel Programming |