JS


Hi all,

I have a macro that lets the usr mark a chart that the usr wants to add serie(s) to. After the usr has picked the data for the new serie I want the macro to return to the sheet that contains the pre selected chart. How can I get this sheet with the information set in the beginning (ACh)

Dim ACh as Object ''' Can be Embeded or chart sheet

Set ACh = Nothing

Set ACh = Application.ActiveChart

code....

''' Return to the sheet containing the chart

If TypeName(ACh.Parent) = "Workbook" Then
ACh.Activate ''' Works fine
ElseIf TypeName(ACh.Parent) = "ChartObject" Then

''' What should I write here
End If

Thankful for help!

Regards

Jonas





Re: activate a sheet containing a specific chrtobject

Andy Pope


Hi,

You would need to activate the parent parent of the chartobject.

aCH.Parent.Parent.Activate






Re: activate a sheet containing a specific chrtobject

JS

Thank you Andy!