Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Selection type

Hi all,

I have done a lot of VBA programming in PowerPoint, but I'm new to
Excel.

Now, want to manipulate charts, but I cannot figure out how to detect
if on or more charts on the active sheet are selected or not.

How do you discern between 'selection types' in Excel?

Thanks in advance! :-)

Martin

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Selection type

Martin,

Use the TypeOf operator. E.g.,

If TypeOf Selection Is Excel.ChartArea Then
Debug.Print "Chart selected"
End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Martin Stender" wrote in message
oups.com...
Hi all,

I have done a lot of VBA programming in PowerPoint, but I'm new
to
Excel.

Now, want to manipulate charts, but I cannot figure out how to
detect
if on or more charts on the active sheet are selected or not.

How do you discern between 'selection types' in Excel?

Thanks in advance! :-)

Martin



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 112
Default Selection type

Hi Martin,

The following macro should give you some more ideas.
It is worth noting that with regards to charts, clicking on a commandbutton
to run such code can change which part of the chart is selected.


Regards,
Vic Eldridge


Sub WhatIsSelected()

MsgBox "TypeName = " & TypeName(Selection)

If TypeName(Selection) = "DrawingObjects" Then
Dim DrwObj As Object
For Each DrwObj In Selection
MsgBox TypeName(DrwObj)
Next
End If

End Sub




"Martin Stender" wrote:

Hi all,

I have done a lot of VBA programming in PowerPoint, but I'm new to
Excel.

Now, want to manipulate charts, but I cannot figure out how to detect
if on or more charts on the active sheet are selected or not.

How do you discern between 'selection types' in Excel?

Thanks in advance! :-)

Martin


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
dialog box selection type ORLANDO VAZQUEZ[_2_] Excel Discussion (Misc queries) 1 September 30th 09 08:24 PM
type of selection if selection is chart Chimanrao Excel Programming 0 November 11th 05 03:44 AM
Object Type of a selection... counting rows in a selection Acid-Sky[_2_] Excel Programming 3 August 23rd 05 09:53 AM
Understanding Selection "Type" MWE[_27_] Excel Programming 2 February 2nd 04 08:40 PM
How to find what object type is returned from Selection property ? Krzysztof Klimczak[_3_] Excel Programming 1 October 2nd 03 11:33 PM


All times are GMT +1. The time now is 02:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"