Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default ammend to exlude sheet(s)


Need to exlude (add to code) sheets "S2" and "S4" sheets along with
"S3".


Option Explicit


Sub testme3()


Dim mysheets
Dim wks As Worksheet
Dim firstselected As Boolean


Set mysheets = ActiveWindow.SelectedSheets


firstselected = False
For Each wks In mysheets
If ucase(wks.Name) = "S3" Then
'do nothing
ElseIf Not firstselected Then
wks.Select
firstselected = True
Else
wks.Select Replace:=False
End If
Next wks


End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default ammend to exlude sheet(s)

Option Explicit
Sub testme3()

Dim mySheets as Object
Dim wks As Worksheet
Dim FirstSelected As Boolean

Set mySheets = ActiveWindow.SelectedSheets

FirstSelected = False
For Each wks In mySheets
Select Case UCase(wks.Name)
Case Is = "S2", "S3", "S4"
'do nothing
Case Else
If Not FirstSelected Then
wks.Select
FirstSelected = True
Else
wks.Select Replace:=False
End If
End Select
Next wks

End Sub


"J.W. Aldridge" wrote:

Need to exlude (add to code) sheets "S2" and "S4" sheets along with
"S3".

Option Explicit

Sub testme3()

Dim mysheets
Dim wks As Worksheet
Dim firstselected As Boolean

Set mysheets = ActiveWindow.SelectedSheets

firstselected = False
For Each wks In mysheets
If ucase(wks.Name) = "S3" Then
'do nothing
ElseIf Not firstselected Then
wks.Select
firstselected = True
Else
wks.Select Replace:=False
End If
Next wks

End Sub


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default ammend to exlude sheet(s)

thanx!
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
Exlude Zero Values from Average Robin G[_2_] Excel Discussion (Misc queries) 2 January 23rd 08 02:37 AM
Please ammend Formula Burhan Uddin[_2_] Excel Programming 2 May 27th 07 11:40 AM
pls help ammend progress bar code Susan Excel Programming 4 December 28th 06 06:03 PM
need to ammend a formula Robb27 Excel Worksheet Functions 2 August 5th 06 08:04 AM
Import data file but exlude information I already have in sheet? Tom R Excel Discussion (Misc queries) 1 May 3rd 05 12:07 PM


All times are GMT +1. The time now is 06:50 PM.

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"