• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

DeSelect the Particular Sheets after Selecting All Sheets

nagovind

Member
Dear All

I'm able to select all sheets by the code

ActiveWorkbook.Sheets.Select

Once after selecting all sheets how to deselect the particular sheets with the sheet names starting with SKIP

Please advise
Regards
Govind
 
Govind

You are better off building teh list of worksheets from scratch

Try the following code:

Code:
Sub Select_Sheets()
For i = 1 To Sheets.Count
  If Left(Worksheets(i).Name, 4) <> "Skip" Then
  Worksheets(i).Select (False)
  End If
Next 
End Sub
 
Dear Hui,

Thank you
--
Thanks a lot for your codes

Perfectly worked....

With this code can manipulate as many things....

Regards
Govind
 
Dear Hui,

Code:
Sub Select_Sheets()
For i = 1 To Sheets.Count
If Left(Worksheets(i).Name, 4) <> "Skip"Then
  Worksheets(i).Select (False)
EndIf
Next
EndSub
This code suddenly stopped working
Please help

Regards
Govind
 
Last edited by a moderator:
The two words
EndIf and EndSub both should have spaces in the middle
eg: End If and End Sub

What else changed?

How is the code ran?
 
Do you still have a worksheet called Skip?

The code works fine for me ?
 
Back
Top