Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default What is Selected?

How can I determine or identify what is Selected on the ActiveSheet? Is it a
cell or group of cells? Is it a Shape or Chart or something else?
--
Gary''s Student - gsnu201001
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default What is Selected?

s = TypeName(Selection)

If that returns "Range" go on to examine the range object, eg
Selection.Areas.Count ' if 1 it's a multiple selection
Selection.Count ' if =1 it's a single cell

With objects Selection returns the name at the DrawingObject level, eg
"Rectangle" or if multiple "DrawingObjects". With an Active chart it'll be
the name of the chart element, eg PlotArea, Series, Point, etc

Regards,
Peter T

"Gary''s Student" wrote in message
...
How can I determine or identify what is Selected on the ActiveSheet? Is it
a
cell or group of cells? Is it a Shape or Chart or something else?
--
Gary''s Student - gsnu201001



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default What is Selected?

Thanks!
--
Gary''s Student - gsnu201001


"Peter T" wrote:

s = TypeName(Selection)

If that returns "Range" go on to examine the range object, eg
Selection.Areas.Count ' if 1 it's a multiple selection
Selection.Count ' if =1 it's a single cell

With objects Selection returns the name at the DrawingObject level, eg
"Rectangle" or if multiple "DrawingObjects". With an Active chart it'll be
the name of the chart element, eg PlotArea, Series, Point, etc

Regards,
Peter T

"Gary''s Student" wrote in message
...
How can I determine or identify what is Selected on the ActiveSheet? Is it
a
cell or group of cells? Is it a Shape or Chart or something else?
--
Gary''s Student - gsnu201001



.

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
Multiple cells or columns are selected instead of selected cell or Mikey Excel Discussion (Misc queries) 1 April 29th 09 09:48 PM
Cells are selected but aren't displayed as selected Nifty Excel Discussion (Misc queries) 2 September 17th 06 07:22 PM
Cells are selected but aren't displayed as selected Nifty Excel Worksheet Functions 0 September 17th 06 11:34 AM
Macro to take selected cells times a selected cell Craig Excel Programming 4 October 24th 05 12:54 AM
how do i make it so that when a sheat is selected either via link or tab, that xlLastCell is selected. the last on the sheet. Daniel Excel Worksheet Functions 1 July 12th 05 01:30 AM


All times are GMT +1. The time now is 07:44 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"