Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How about this?
With .ActiveWorkbook .Sheets("Sheet1").Select .ActiveSheet.ChartObjects("Chart 1").Activate .ActiveChart.ChartArea.Copy End With On Dec 21, 11:26*am, Stanley wrote: Given the code below, does anyone have any suggestions on how to obtain the active chart/chartobject's name so that I can address Shape(name) properly when I try ot move the shape? Code:
Sub LT(wbname As String, wsname As String) * ' Graphing Lifetime Results * * Dim normalgraph As Chart * * * * * * * *' normal graph variable * * Dim regressgraph As Chart * * * * * * * ' regression graph variable * * Dim twoGraphs As ChartObjects * * * * * * *'Chartobjects for embedded charts * * Dim ngName As String * * * * * * * *'normal graph name for moving the chart * * Dim rgName As String * * * * * * * *'regression graph name for moving the chart * * Dim i As Long * * * * * * * * * * * * * ' loop counter * * Dim colEnd As Long * * * * * * * * * * * * ' end of a column * * Workbooks(wbname).Sheets(wsname).Activate * * * 'activate worksheet of interest * * Let colEnd = Range("c2").End(xlDown).Row * * ' Select data range * * Range(Cells(2, 2), Cells(colEnd, 6)).Select * * ' insert new graph for showing Fuel cell voltage, flow, temperature, * * ' and fuel cell current * * Set normalgraph = Charts.Add * * Set normalgraph = normalgraph.Location(whe=xlLocationAsObject, Name:=wsname) * * ngName = normalgraph.Name * * 'more code Thanks! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
can't active chart | Charts and Charting in Excel | |||
Chart & Active Sheet | Excel Programming | |||
active chart- please help | Charts and Charting in Excel | |||
Dynamically chart active row | Charts and Charting in Excel | |||
How to embed chart in active worksheet with VBA? | Excel Programming |