G
gillettos
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(iRange,
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/showthread.php?t=207715
http://www.thecodecage.com/forumz
--- news://freenews.netfront.net/ - complaints: (e-mail address removed) ---
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(iRange,
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/showthread.php?t=207715
http://www.thecodecage.com/forumz
--- news://freenews.netfront.net/ - complaints: (e-mail address removed) ---