PDA

View Full Version : Check whether a chart is selected by the user or not using VBA



LalitPandey87
10-04-2011, 07:58 AM
Hi,

I need a function which return the chart name which is selected by the user, without assigining macro to the chart.
By clicking a button i need the activated chart name. so that mean The function will be assigned to this button.

Thanx in Advance.

Admin
10-04-2011, 10:05 AM
Hi Mohan,

Welcome to ExcelFox !!!

may be..


Dim chtSelected As Chart

On Error Resume Next
Set chtSelected = ActiveChart
On Error GoTo 0
If chtSelected Is Nothing Then
MsgBox "No chart selected", vbInformation
Else
MsgBox chtSelected.Name
End If

LalitPandey87
10-04-2011, 10:11 AM
Thanx Admin for Ur Quick Reply.:o

LalitPandey87
10-10-2011, 01:46 PM
Working!!!!!!!!!!!!.
:o