#1
|
|||
|
|||
How to write a code which select a chart when clicking on it?
How to write a code which select a chart when clicking on it?
I have written following macro to display a chart in another worksheet (customizing “excel moving chart feature”) when clicking on it. (I want to assign this macro to all my charts). My problem is that I don’t Know how to select (activate) the chart I want to have it displayed in another worksheet. (see the attachment.) Can you guides me on this issue? Sub enlargchart() On Error Resume Next Application.DisplayAlerts = False ActiveWorkbook.Charts.Delete ActiveChart.ChartArea.Copy range("A1").Select ActiveSheet.Paste ActiveChart.Location Where:=xlLocationAsNewSheet Application.DisplayAlerts = True End Sub |
#2
|
|||
|
|||
I have found the answer of this question: In these situations, using “Application.Caller” ,Can do the job. For example, this line of code can activates the clicked chart: ActiveSheet.ChartObjects(Application.Caller).Activ ate
|
Tags |
activate, chart |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
VBA Newbie (Trying to write a code to copy and paste info from one sheet to another) | Forum2000s | Excel Programming | 2 | 05-07-2017 04:51 AM |
Can I select the entire second or third level in an org. chart? | blockie | Word | 1 | 08-25-2014 11:19 PM |
Way to select a range using the mouse on a chart? | omahadivision | Excel Programming | 6 | 12-29-2012 09:21 AM |
VBA code for count w and write into another column in excel | tomlam | Excel Programming | 2 | 10-09-2012 03:56 AM |
How to write in Word from Select query | lakhan.p | Word | 0 | 03-27-2009 07:25 AM |