Results 1 to 4 of 4

Thread: Check whether a chart is selected by the user or not using VBA

  1. #1
    Senior Member LalitPandey87's Avatar
    Join Date
    Sep 2011
    Posts
    222
    Rep Power
    14

    Smile Check whether a chart is selected by the user or not using VBA

    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.
    Last edited by LalitPandey87; 10-04-2011 at 08:14 AM.

  2. #2
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    Hi Mohan,

    Welcome to ExcelFox !!!

    may be..

    Code:
    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
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  3. #3
    Senior Member LalitPandey87's Avatar
    Join Date
    Sep 2011
    Posts
    222
    Rep Power
    14
    Thanx Admin for Ur Quick Reply.:o

  4. #4
    Senior Member LalitPandey87's Avatar
    Join Date
    Sep 2011
    Posts
    222
    Rep Power
    14
    Working!!!!!!!!!!!!.
    :o
    Last edited by LalitPandey87; 10-10-2011 at 02:07 PM.

Similar Threads

  1. Replies: 3
    Last Post: 05-17-2013, 01:22 PM
  2. Replies: 3
    Last Post: 05-14-2013, 03:25 PM
  3. Replies: 2
    Last Post: 09-24-2012, 06:24 PM
  4. Copy selected data to other excel sheet
    By dhiraj.ch185 in forum Excel Help
    Replies: 2
    Last Post: 02-02-2012, 06:23 AM
  5. tracking changes and prompt user
    By princ_wns in forum Excel Help
    Replies: 1
    Last Post: 01-22-2012, 03:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •