View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
gillettos gillettos is offline
external usenet poster
 
Posts: 1
Default Next Without For


Why am I having problems with the following code below.....

Basically I get the "Next witout For" Compile error when running the
code. Understand what its sayin, but by placing the "Next iRange"
outside the If statement kinda defeats the object of what I want to
do....!

Any Ideas????



For iRange = 1 To iRowNo 'set a loop of rows to cyclce down

strUsrID = ActiveWorkbook.Sheets("Administrators").Cells(iRan ge,
1).Text

For iRange = 1 To iRowNo 'set a loop of rows to cyclce down


If strUsrID = iUsrId Then

Load FrmAdmin
FrmAdmin.Show
Unload FrmNavigation

Else

Next iRange 'WONT WORK, ERROR = "Next Without For"

MsgBox "You are not an authorised Administrator of the System",
vbInformation, "Information" 'and display message

End If


--
gillettos
------------------------------------------------------------------------
gillettos's Profile: http://www.thecodecage.com/forumz/member.php?u=2090
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=207715

http://www.thecodecage.com/forumz


--- news://freenews.netfront.net/ - complaints: ---