View Single Post
 
Old 06-24-2023, 10:53 PM
soroush.kalantari soroush.kalantari is offline Windows 10 Office 2016
Competent Performer
 
Join Date: Jun 2021
Posts: 124
soroush.kalantari is on a distinguished road
Default 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
Attached Files
File Type: xlsm enlargecharts.xlsm (41.9 KB, 6 views)
Reply With Quote