View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
tommo_blade tommo_blade is offline
external usenet poster
 
Posts: 31
Default HELP=What Is Wrong With This Code ?

that does not work either, now fails at the line with the "Ucase"
statement, I get the error when I select my worksheet, the vba code
behind the worksheets calls this piece of code.

the error is a run-time error '57121':
Application-defined or Object-defines error


Public Sub PopulateDropDowns()

Dim WS As Integer
Dim i As Integer
Dim y As Integer

WS = 0

For i = 1 To Sheets.Count
If UCase(Sheets(i).Name) = "PLAYER LIST" Then
Sheets(i).Select
'MsgBox "FOUND PLAYER LIST:" & Sheets(i).Name
WS = i
Exit For
End If
Next i

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

== CODE HERE <==

end Sub