View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jack Sheet Jack Sheet is offline
external usenet poster
 
Posts: 47
Default Excluding sheet from group of selected sheets

Hi all
Have got this far

Dim sGroupedWS() As String
Dim lGroupedWSCount As Long
Dim lCounter As Long
lGroupedWSCount = ActiveWindow.SelectedSheets.Count
For lCounter = 1 To lGroupedWSCount
sGroupedWS(lCounter) = ActiveWindow.SelectedSheets(lCounter).Name
Next lCounter

Problem:
First I want to check whether the worksheet "HELP" is the only selected
sheet and if it is then exit sub.
Assuming that "HELP" is not the only selected sheet (and it may not even be
selected at all) then I want to exclude the worksheet "HELP" from the group
of selected sheets, ie unselect that particular sheet but otherwise leave
the selected sheets unchanged. If "HELP" was the activesheet then I do not
really care what sheet becomes the activesheet when "HELP" is unselected.

Overall intention is this (and there may be a better approach than the
above)
The macro deletes the selected sheets, which may be a group of selected
sheets. The only restriction that I wish to impose is that the worksheet
"HELP" must NOT be deleted if it is included in the group of selected sheets
(and it may not be included).

Any help gratefully received.

--
Return email address is not as DEEP as it appears