• TypeName(Selection) (XP/2003 UK)

    Author
    Topic
    #455709

    Hi,

    Got a small check where I’m trying to secure that the user has in fact selected a chart before firing a formatting macro. Has so far worked fine but testing it now with a range or single cell selected in a worksheet, it does not enter the ‘Msgbox’ option informing the user of the incorrect selection. Can anybody tell me what’s wrong here…??

    Sub CheckSelection
    Debug.Print TypeName(Selection)

    Select Case TypeName(Selection)
    Case “ChartArea”, “PlotArea”, “Series”, “Legend”, “Axis”, “ChartTitle”
    ‘Everything’s fine do nothing
    Case “Nothing” Or “Range”
    MsgBox “Please click on the chart you want to format before you proceed”, vbInformation, CoName
    End Select

    End Sub

    Viewing 0 reply threads
    Author
    Replies
    • #1135601

      What happens if you change the line to:

      Case "Nothing", "Range"

      I get an error with that line due to the Or not being text…

      Steve

    Viewing 0 reply threads
    Reply To: TypeName(Selection) (XP/2003 UK)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: