how to find if multiple chart objects are selected?

C

Chimanrao

hi
how do i find if multiple chart objects are selected by the user using
the ctrl + click mechanism?
chiman
 
P

Peter T

Sub test()
Dim ob As Object, s As String

If TypeName(Selection) = "DrawingObjects" Then
For Each ob In Selection
If TypeName(ob) = "ChartObject" Then
cnt = cnt + 1
End If
Next
s = cnt & " / " & Selection.Count & _
" selected objects are ChartObjects"
Else
s = TypeName(Selection)
End If

MsgBox s

End Sub

Strangely, when I first tested in Excel 97 if multiple chartobjects and only
chartobjects were selected TypeName(Selection) returned "ChartObject". But
later in testing it returned "DrawingObjects" same as later versions. Odd!

Regards,
Peter T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top