Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I turn off [Group] mode? | Excel Discussion (Misc queries) | |||
Ability to Group and Ungroup while in Protection Mode | Excel Discussion (Misc queries) | |||
Tab Colors in Group Mode | New Users to Excel | |||
detect ctrl-c was pressed (in copy mode) from vba? | Excel Discussion (Misc queries) | |||
Page setup whilst in Group mode | Excel Discussion (Misc queries) |