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

Is there a standard way to detect whether more than one sheet is selected in
a workbook?

There doesn't seem to be a Worksheets(x).Selected property, which would
allow me to flip through the workbook and see whether a group of sheets is
selected rather than a single one.

What I'm doing now is this:

If Right(Application.Caption, 7) = "[Group]" Then

which is kludgy and may be dangerous.

There must be a better way to do this, but I can't seem to find it.

-Tim Aurthur



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Detect Group mode

IF ActiveWindow.Selectedsheets.count 1 Then

--
Regards,
Tom Ogilvy



"Tim Aurthur" wrote in message
...
Is there a standard way to detect whether more than one sheet is selected

in
a workbook?

There doesn't seem to be a Worksheets(x).Selected property, which would
allow me to flip through the workbook and see whether a group of sheets is
selected rather than a single one.

What I'm doing now is this:

If Right(Application.Caption, 7) = "[Group]" Then

which is kludgy and may be dangerous.

There must be a better way to do this, but I can't seem to find it.

-Tim Aurthur





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Detect Group mode

Hi Tim:

How about the following?:

If ActiveWindow.SelectedSheets.Count 1 Then '...

Regards,

Vasant.

"Tim Aurthur" wrote in message
...
Is there a standard way to detect whether more than one sheet is selected

in
a workbook?

There doesn't seem to be a Worksheets(x).Selected property, which would
allow me to flip through the workbook and see whether a group of sheets is
selected rather than a single one.

What I'm doing now is this:

If Right(Application.Caption, 7) = "[Group]" Then

which is kludgy and may be dangerous.

There must be a better way to do this, but I can't seem to find it.

-Tim Aurthur





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Detect Group mode

Ken Wright provides a ditty in this thread.

http://www.google.com/groups?hl=en&l...a1fc2d&rnum=38

Sub CountSelected()

Dim sc As Long
Dim sh As Worksheet

sc = 0
For Each sh In ActiveWorkbook.Windows(1).SelectedSheets
sc = sc + 1
Next sh
MsgBox sc

End Sub

HTH
Paul
--------------------------------------------------------------------------------------------------------------
Be advised to back up your WorkBook before attempting to make changes.
--------------------------------------------------------------------------------------------------------------
Is there a standard way to detect whether more than one sheet is selected in
a workbook?

There doesn't seem to be a Worksheets(x).Selected property, which would
allow me to flip through the workbook and see whether a group of sheets is
selected rather than a single one.

What I'm doing now is this:

If Right(Application.Caption, 7) = "[Group]" Then

which is kludgy and may be dangerous.

There must be a better way to do this, but I can't seem to find it.

-Tim Aurthur



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
How do I turn off [Group] mode? tothemax Excel Discussion (Misc queries) 4 April 2nd 23 08:13 PM
Ability to Group and Ungroup while in Protection Mode FredL Excel Discussion (Misc queries) 0 January 15th 10 12:45 AM
Tab Colors in Group Mode akkrug New Users to Excel 1 April 24th 08 06:25 PM
detect ctrl-c was pressed (in copy mode) from vba? Mad Scientist Jr Excel Discussion (Misc queries) 3 October 29th 06 06:34 AM
Page setup whilst in Group mode Louise Excel Discussion (Misc queries) 2 October 19th 06 04:45 PM


All times are GMT +1. The time now is 09:10 AM.

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

About Us

"It's about Microsoft Excel"