LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default HELP=What Is Wrong With This Code ?

Hi, for the life of me I cannot see why this wont run, all it needs to
do is loop around a number of sheets in a workook and flag up when it
finds the correct one, the code fails at the "Instr" line, I have also
tried a staright "equals" match, it does not like the object
"Worksheets(x).Name":

WS = 0
For x = 1 To Worksheets.Count
'MsgBox "SHEET:" & Worksheets.Count

If InStr(1, Worksheets(x).Name, "Player List") < 0 Then
MsgBox "FOUND PLAYER LIST:" & x
WS = x
End If
Next x

If WS = 0 Then
MsgBox "Unable to find 'Players List' worksheet"
Else

CODE GOES HERE



thanks..
 
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
What is wrong with this code?!? James8309 Excel Programming 1 June 5th 08 02:18 PM
Wrong code? GBH99 Excel Programming 3 September 12th 07 05:40 PM
What is wrong with this code? sungen99[_32_] Excel Programming 3 October 12th 05 08:12 PM
What's wrong with the code,pls hv a look changeable[_10_] Excel Programming 0 November 3rd 04 09:56 AM
What's wrong with the code,pls hv a look changeable[_4_] Excel Programming 1 November 3rd 04 02:57 AM


All times are GMT +1. The time now is 10:06 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"