Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How can one determined what "type" of selection has been made? Since a
selection could be a range, a shape, a chartobject, etc., how do you know which type and how can you determine which particular instance of that type? Thanks --- Message posted from http://www.ExcelForum.com/ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() TypeName is what you're after: Sub test() MsgBox TypeName(Selection) End Sub Another way is: If TypeOf Selection Is Rectangle Then MsgBox "Selection is a Rectangle" -- Rob van Gelder - http://www.vangelder.co.nz/excel "MWE " wrote in message ... How can one determined what "type" of selection has been made? Since a selection could be a range, a shape, a chartobject, etc., how do you know which type and how can you determine which particular instance of that type? Thanks --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ron: Your reply was most helpful. However, I still can
not quite do what I want. Assume a worksheet on which there are various objects, e.g., charts, pictures, textboxes, rectangles, etc. I wish to be able to select any of these objects and know its "type" (you already showed me how to do that) and be able to work with that specific object. For a range or chart, working with the selected object is understood (active cell, activechart, etc). But for a item that the worksheet includes in its collection of shapes, I do not know how to identify the specific instance. Thanks -----Original Message----- TypeName is what you're after: Sub test() MsgBox TypeName(Selection) End Sub Another way is: If TypeOf Selection Is Rectangle Then MsgBox "Selection is a Rectangle" -- Rob van Gelder - http://www.vangelder.co.nz/excel "MWE " wrote in message ... How can one determined what "type" of selection has been made? Since a selection could be a range, a shape, a chartobject, etc., how do you know which type and how can you determine which particular instance of that type? Thanks --- Message posted from http://www.ExcelForum.com/ . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
"Type mismatch" when I try to fill an Array variable with "+" | Excel Discussion (Misc queries) | |||
how do I type "itis" without Excel putting a space "it is"? | Excel Worksheet Functions | |||
When I type "13" the spreadsheet shows "14." Possibilities? | Excel Discussion (Misc queries) | |||
Where is the toolbar with the "bold type", "font type", options | New Users to Excel |